How can I load a form and allow it to run it's code in the form load but keep it not visible. I want it to do what it needs to but but not display.
Thanks for the help.
Mythos
Printable View
How can I load a form and allow it to run it's code in the form load but keep it not visible. I want it to do what it needs to but but not display.
Thanks for the help.
Mythos
A Windows Form is used to express visible data to the User. If you don't require a GUI, then you should make a Windows Service.
form1.hide() ;) then use form1.show() when you wish to see it
edit. weirddemon is right tho a service would be better, my example works well with multiple forms
Just because you don't need a GUI does not mean you should make a windows service.
Services aren't just GUIless executables. There is more to it than that.
You can just make a winforms application without any forms, and just create a public sub main() to be the entry point of your exe, or you can use the application framework and run whatever code you want to run before any form is shown in the applications startup event.
Of course what solution you are going to want to use will depend on IF you do ever, at some point, want to show a form or not.