Original Nutsbell Series---WinForm How to do the startup page

Source: Internet
Author: User
Tags foreach tostring
WinForm How to do the startup page
Start Page Form2.cs
Add a pictureBox1 to the form and a Label1
PictureBox1 to display software images
Label1 used to display hints

Main Page Form1.cs
In the Page_Load event in Form1
private void Form1_Load (object sender, System.EventArgs e)
{
Form2 ff=new Form2 ();
Kaifeng Noodles
Ff. Show ();
Populating database names
ff.label1.text= "Populate database name ...";
Key locations Otherwise, the Label1 on the Form2 cannot be refreshed.
And every time you update Label1, you need
Application.doevents ();

Sqlad_databases.fill (DATASET11);
foreach (DataRow myrow in dataset11.tables["DataBases"). Rows)
{
DATABASENAME.ITEMS.ADD (myrow["Catalog_name"). ToString ());
}

Populating table information
ff.label1.text= "Fill table information ...";
Application.doevents ();
Filltableinfo ();
datagrid1.datasource=dataset11.tables["Tables"];

Fill field Information
ff.label1.text= "Fill field information ...";
Fillfiledinfo (dataset11.tables["Tables"). rows[datagrid1.currentrowindex]["table_name"]. ToString ());
datagrid2.datasource=dataset11.tables["COLUMNS"];

Load Template
ff.label1.text= "Load Template ...";
Application.doevents ();

Sourcebox.loadfile (@ "\templet\default.txt", Richtextboxstreamtype.plaintext);

Populate template Catalogs
ff.label1.text= "Populate template directory ...";
Application.doevents ();

DirectoryInfo cd= New DirectoryInfo (@ ". \templet\");
foreach (FileInfo f in CD.) GetFiles ())
{
TEMPLETFILES.ITEMS.ADD (F.name);
}
templetfiles.text= "Default.txt";
Tt
Sqldataadapter4.fill (DATASET11);
Sqldataadapter3.fill (DATASET11);

Close the Startup window
ff.label1.text= "complete.";
Application.doevents ();
Close Cover
Ff. Close ();
}




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.