I need to hide my Form
at startup of the operating system(windows 7).
To accomplish that, I tried the solution:-
if (Program.Args == "/startup")
{
this.Hide();
this.ShowInTaskbar = false;
}
I had the above code in my form1_Load Event, Program.Args
is the command line argument supplied to my program.
What is wrong in the above code?
How can I accomplish hiding of my form through command line arguments?
As some people suggested to use
this.WindowState = FormWindowState.Minimized
this.ShowInTaskbar = false
I tried it but my application freezes, like this:-
If I comment out the line
this.ShowInTaskBar = false
it runs normally but shows the icon in task bar.
Normal Look of the application is :-