Display messagebox in dll library

前端 未结 2 544
-上瘾入骨i
-上瘾入骨i 2021-01-24 18:12

I am writing a dll library (for example for checking login details of a user) and I want to pop up a confirmation dialog or a informational dialog in the process, for example

2条回答
  •  Happy的楠姐
    2021-01-24 19:12

    To accomplish this you need to right click on the project and select "Add Reference", then select the ".NET" tab and click "System.Windows.Forms". Then this should work inside the .dll:

    System.Windows.Forms.MessageBox.Show("Hello World!");
    

    Of course this is a bad idea for the original poster (as covered by CodeCaster).

提交回复
热议问题