VB.net program with no UI

10.1k views Asked by At

I'm making a VB.net program via a text file and I'm compiling it using vbc.exe via command line. I'm trying to get just a simple program to run in the background of my computer. Problem is, it displays the annoying console window. How do I get nothing to show? No form, no console?

3

There are 3 answers

1
LarsTech On BEST ANSWER

I think you need a form of some kind to keep the message loop going.

Maybe a NotifyIcon type program. It would keep it away from the task bar and desktop areas.

And then customize the NotifyIcon to "Only Show Notifications" from the "Customize" menu for your icon using Windows.

0
MemoryVandal On

Just use windows forms application don't load the form at all! Just go in project properties and uncheck enable application framework. Now, in the startup object dropdown, select "sub main". Add a module to the project and put a Public Sub Main() in it. You do all the stuff in main() and don't load form at all.

5
Jet On

1) Add a module in your project, and create Sub Main
2) Write whatever you want in Sub Main,and MAKE SURE you end it with this statement:

Application.Run()

3) Open properties of your project and choose "Sub Main" as startup object

So , your application will have NO INTERFACE (NO FORM / NOT CONSOLE APPLICATION) and will run from Sub Main(), in addition it will NOT TERMINATE once all the code in Sub Main has executed.Your program will run like a NORMAL windows form application, and will only exit when you want.