Jay
Jay

Reputation: 33

Hide a C# GUI Form

Despite the irony of this question, how could you accomplish hiding a form, or even better running the complete application silently?

Upvotes: 3

Views: 1514

Answers (5)

Gustavo Mori
Gustavo Mori

Reputation: 8386

Set its WindowState to Minimized.

You can also hide it from the Taksbar by setting ShowInTaskbar=false;

With these two properties, you can fully control the display of your form, depending on your own requirements.

Upvotes: 2

Rosmarine Popcorn
Rosmarine Popcorn

Reputation: 10967

http://www.go4expert.com/forums/showthread.php?t=973 ,here you can Hide any Window you want from C#.

Upvotes: 1

recursive
recursive

Reputation: 86144

If you don't your form to be shown, don't call .Show() on your form from Main().

Upvotes: 3

Hasan Fahim
Hasan Fahim

Reputation: 3885

To run an application silently make it a window's service rather than winforms app

Upvotes: 3

AJ.
AJ.

Reputation: 16729

Is there any reason you need to use a form? Why not make it a console application? If you need both scenarios, both UI and "silent," you can put the common functionality in a separate, class library project, compile it, and reference the DLL in both a winforms project and a console project.

Upvotes: 3

Related Questions