Special form creation: use C # To start the welcome Interface

Source: Internet
Author: User

Step 1: MasterProgramStart 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 (form2) in the _ load event in the main form (form1)

As follows:

Private void form1_load (Object sender, eventargs E)
{
// Start the form
Form2 mysplashform = new form2 ();
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 form2_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.