Hi, I am trying to make a windows forms application that starts using Sub Main instead of the Form1_Load event.

I have tried putting this in Public Class Form1

Public Shared Sub Main()
    End Sub

and also tried putting this at the top of the programs code outside the class:

Public Module Main
    Public Sub Main()
        Application.Run(New Form1())
    End Sub
End Module

I can only get them to run when I make the app a console app. Is there a way to run these things either without making it a console app, or without actually showing the console?

I want to make a simple server app, but I don't want the server socket's loop to interfere with the forms functions

thanks for any help

edit: I would just use C++ but sockets are much harder

Why don't you start the form hidden?

I'm just gonna use C++

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.