question

kavehrahimi-5744 avatar image
0 Votes"
kavehrahimi-5744 asked XingyuZhao-MSFT edited

Call form from module problem

Hi ,I run form by delegate in my module,the call process doesn't go ok and only the 'sub main' procedure runs.
My module is in consoleapp written,and the form in windowsapp.
My code is:
Imports System.Management
Imports System.Windows.Forms

Module module1
Sub main()
'Console.WriteLine("ok")
End Sub
Public Class kh
Public Shared Sub dosomething()
Task.Run(Sub() updateform())
End Sub
Public Delegate Sub formdelegate()
Public Shared Sub updateform()
Application.Run(New Form)
Console.WriteLine("ok")
End Sub

     Private Declare Function ch341open Lib "ch341dll.dll" (ByVal iindex As Integer) As Integer
 End Class

End Module
Can anybody help me?
Thanks

dotnet-visual-basic
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Why are you trying to run a 'Form' this way?

0 Votes 0 ·

I have a main program as module and want to notify usb port arrival with a window and then return to main program.
That is why I want to do so.

0 Votes 0 ·
0 Votes 0 ·

0 Answers