I expected problems because I knew I did not have the Sub Main defined in my project. I added a class file and entered the fallowing code:
Public Class Main
Public Shared Sub Main()
Application.Run(New Form1)
End Sub
End Class
Several examples I saw had main defined with (ByVal args() As String) as the parameter. One thread on the subject indicated that you can add a module instead of a class. Here is the syntax for that.
Module Main
Public Sub Main(ByVal args() As String)
Application.Run(New Form1)
End Sub
End Module
You will notice that the shared keyword is left off inside the module.
No comments:
Post a Comment