Hide form on load!

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.
 
B

Bruce Wood

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

?
 
D

DBC User

Hi Bruce,

Thanks, I didn't try both the combination instead I tried one and the
other. That was my mistake. Thanks.
 
J

John B

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top