How to hide the startup form
-
Can anybody tell me how to make the startup form invisible. The following code snippet in the included MSDN help displays the form for a while and then the form is closed automatically. ' Visual Basic Sub Main() ' Instantiate a new instance of Form1. Dim f1 as New Form1() ' Display a messagebox. This shows the application is running, ' yet there is nothing shown to the user. This is the point at ' which you customize your form. System.Windows.Forms.MessageBox.Show( _ "The application is running now, but no forms have been shown.") ' Customize the form. f1.Text = "Running Form" ' Show the instance of the form modally. f1.ShowDialog() End Sub
reman
-
Can anybody tell me how to make the startup form invisible. The following code snippet in the included MSDN help displays the form for a while and then the form is closed automatically. ' Visual Basic Sub Main() ' Instantiate a new instance of Form1. Dim f1 as New Form1() ' Display a messagebox. This shows the application is running, ' yet there is nothing shown to the user. This is the point at ' which you customize your form. System.Windows.Forms.MessageBox.Show( _ "The application is running now, but no forms have been shown.") ' Customize the form. f1.Text = "Running Form" ' Show the instance of the form modally. f1.ShowDialog() End Sub
reman
f1.hide = hides the form (however when the form does an new action after the hide it will apear again) so you might want to use f1.visible = false you can put this code in the load but if you want to make sure you're form is never displayed it might be beter to do it in the activated event hope this helps
-
Can anybody tell me how to make the startup form invisible. The following code snippet in the included MSDN help displays the form for a while and then the form is closed automatically. ' Visual Basic Sub Main() ' Instantiate a new instance of Form1. Dim f1 as New Form1() ' Display a messagebox. This shows the application is running, ' yet there is nothing shown to the user. This is the point at ' which you customize your form. System.Windows.Forms.MessageBox.Show( _ "The application is running now, but no forms have been shown.") ' Customize the form. f1.Text = "Running Form" ' Show the instance of the form modally. f1.ShowDialog() End Sub
reman
Hi, this is how I do it (example is C#):
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form1 form1=new Form1();
// to remain hidden, we don't pass the form to App.Run();
// as a consequence the form must perform an Application.Exit
// when it quits, closes or receives a SessionEnding event.
Application.Run();
}So don't hand over your main form to Run() since that would show it, no matter what you do to the form's properties. And be careful to deal with all normal exits PLUS the sessionending stuff (which normally Run would handle). :)
Luc Pattyn
try { [Search CP Articles] [Search CP Forums] [Forum Guidelines] [My Articles] } catch { [Google] }
-
Can anybody tell me how to make the startup form invisible. The following code snippet in the included MSDN help displays the form for a while and then the form is closed automatically. ' Visual Basic Sub Main() ' Instantiate a new instance of Form1. Dim f1 as New Form1() ' Display a messagebox. This shows the application is running, ' yet there is nothing shown to the user. This is the point at ' which you customize your form. System.Windows.Forms.MessageBox.Show( _ "The application is running now, but no forms have been shown.") ' Customize the form. f1.Text = "Running Form" ' Show the instance of the form modally. f1.ShowDialog() End Sub
reman
Hi, It seems that your are trying to build a SplashScreen, if this is what you want: Go to Project > Add New Item > Splash Screen ... add your touches + Coding ;) Go to Project > ProjectName Property > Application tab > Splash Screen Drop Down List and select the added form (this will be launched first) hope this helps :)
NajiCo http://www.InsideVB.NET[^] It's nice 2b important, but it's more important 2b nice...
-
Can anybody tell me how to make the startup form invisible. The following code snippet in the included MSDN help displays the form for a while and then the form is closed automatically. ' Visual Basic Sub Main() ' Instantiate a new instance of Form1. Dim f1 as New Form1() ' Display a messagebox. This shows the application is running, ' yet there is nothing shown to the user. This is the point at ' which you customize your form. System.Windows.Forms.MessageBox.Show( _ "The application is running now, but no forms have been shown.") ' Customize the form. f1.Text = "Running Form" ' Show the instance of the form modally. f1.ShowDialog() End Sub
reman
There is a good article here on CodeProject at http://www.codeproject.com/csharp/prettygoodsplashscreen.asp on creating a splash screen. I have used it in past applications.
Here are some of my articles. Hope this helps! Joseph Guadagno http://www.josephguadagno.net