How To Hide Main Form at Startup
-
Tuesday, May 06, 2008 9:07 PMhow do i hide my main form at startup?
i tried:
public Form1()
{
InitializeComponent();
this.Visible = false;
}
and
this.Hide();
but that doesnt seem to work. am i missing something?
All Replies
-
Wednesday, May 07, 2008 1:52 PM
Hi corboamnesiac,
Why you want to hide the startup form ?, If you want to hide this form you have to make a it self object and pass the another class constructor .
Hope that, this may be help.
If you don't get it please let me know with the purpose of hide Startup form then....
-
Thursday, May 08, 2008 3:04 AMModerator
Hi,
When a Form is constructed, it does not show itself, unless you call Form.Show or Form.ShowDialog explicitly. Calling the Hide method in the constructor does not take effect, for the Show (or ShowDialog) method is called later than the constructor.
After the Form has been shown, you need to call Form.Hide method explicitly in order to hide it. To demonstrate this, open the Program.cs file, and then modify the Main method to be like this:
[MTAThread]
static void Main()
{
Form frm = new Form1();
Application.Run(frm);
frm.Hide();
}
If you don’t need the to use the UI completely, you can also create a console application instead; otherwise make sure you have means to show the form again.
Best Regards
Chunsheng tang
-
Thursday, May 08, 2008 2:16 PM
Hello,
Does this thread give the answer?
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1576694&SiteID=1
Marthijn.
-
Monday, May 12, 2008 2:02 AMHi
One nice article aboutt this start menu all.
http://www.codeproject.com/KB/mobile/Customize_the_TaskBar_.aspx
Thank you -
Monday, January 23, 2012 8:58 AM
Setting 'this.Visible = false' in GotFocus event works for me.

