Hide form on load!

  • Thread starter Thread starter DBC User
  • Start date Start date
D

DBC User

I am writing an app which is a tray application. When the
computer/application start, it should go directly to tray without
showing the main form.

I did hide on Load method and on initialization but the form does show.
Does any one know how to hide the main form on loading show I have only
tray icon to work with?

Thanks.
 
DBC said:
I am writing an app which is a tray application. When the
computer/application start, it should go directly to tray without
showing the main form.

I did hide on Load method and on initialization but the form does show.
Does any one know how to hide the main form on loading show I have only
tray icon to work with?

Thanks.

Did you try, in the Visual Studio Designer, showing the main Form in
Design View, and then changing the following properties?

WindowState to Minimized
ShowInTaskbar to False

?
 
Hi Bruce,

Thanks, I didn't try both the combination instead I tried one and the
other. That was my mistake. Thanks.
 
Bruce said:
Did you try, in the Visual Studio Designer, showing the main Form in
Design View, and then changing the following properties?

WindowState to Minimized
ShowInTaskbar to False

?
Of course this will still show in the alt+tab window switching.

One (messy) way I found was to handle the LocationChanged event and set
visible to false in there, but in my form load I am moving the form
offscreen which will cause the LocationChanged event to fire.

I dont know if there is a better solution :(
At least it works :)

JB
 
Back
Top