C # compile the startup welcome page

Source: Internet
Author: User

Step 1: The main program starts the main form (form1)
As follows:
Static class Program
{
/// <Summary>
/// Main entry point of the application.
/// </Summary>
[STAThread]
Static void Main ()
{
Application. EnableVisualStyles ();
Application. SetCompatibleTextRenderingDefault (false );
Application. Run (new Form1 ());
}
}
Step 2: Start the welcome page (SplashForm) in the _ Load event in the main form (form1)
As follows:
Private void Form1_Load (object sender, EventArgs e)
{
// Start the form
SplashForm MySplashForm = new SplashForm ();
MySplashForm. ShowDialog ();
}
Step 3: control the display mode of the welcome interface on the welcome interface and use timer to control the disappear time of the welcome interface (in practice, the system usually disappears after reading the required configuration information)
As follows:
Private void Form2_Load (object sender, EventArgs e)
{
// Set the startup form
This. FormBorderStyle = FormBorderStyle. None;
This. BackgroundImage = Image. FromFile ("test.jpg ");
This. timer1.Start ();
This. timer1.Interval = 10000;
}
Private void timereffectick (object sender, EventArgs e)
{
// ...... Read the System Configuration

// Close the startup form
This. Close ();
}
Private void SplashForm_FormClosed (object sender, FormClosedEventArgs e)
{
// Disable the timer
This. timer1.Stop ();
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.