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()
        MsgBox("ASdf")
    End Sub

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

Public Module Main
    Public Sub Main()
        MsgBox("Asdf")
        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

Recommended Answers

All 2 Replies

Why don't you start the form hidden?

It's..thx
I'm just gonna use C++

Be a part of the DaniWeb community

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