|
-
Apr 18th, 2004, 03:38 PM
#1
Thread Starter
Fanatic Member
Add form to project and make it the startup form?
Hello,
I created a project with buttons, textboxes, etc... and ran it. Then I added a new form that will be a splash screen. How do I make the splash screen form startup first?
Thanks!
-
Apr 18th, 2004, 03:41 PM
#2
Lively Member
I know exactly what you're talking about. Ive had this happen to me many times. When I went to the Project Settings and tried to select a new form as the startup, it wasnt there. I am also unsure of how to fix this. It seems to be random.
James
Visual Studio .net 2003 EA
VB .net
C#
-
Apr 18th, 2004, 03:56 PM
#3
PowerPoster
You need a main method in the startup form (although, I haven't tried it, I don't think it matters which form it is in). Look through the start up form right now, find the Main method, and you just need to cut it, paste it into the form you want to start. (Make sure you adjust the Application.Start(Form1) call).
-
Apr 18th, 2004, 03:57 PM
#4
PowerPoster
Looks something like this:
static void Main()
{
Application.Run(new MainForm());
}
-
Apr 18th, 2004, 05:43 PM
#5
Thread Starter
Fanatic Member
Thanks. I had noticed that, but when I messed with it would not work. I basically removed that from the intial main form and then pasted it into the splash form and then selected the splash form as startup (now that it shows up). Here is a clip of the code relating to where it goes.
#region Windows Form Designer generated code
/// <summary>
Required method for Designer support - do not modify
/// the contents of this method with the code editor.
</summary>
///
[STAThread]
static void Main()
{
Application.Run(new frmSplash());
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.Size = new System.Drawing.Size(300,300);
this.Text = "frmSplash";
}
#endregion
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|