First, the buttons of the MessageBox
MessageBox.Show can appear a dialog box with a button
For example:
DialogResult dr = MessageBox.Show ("Do you want to continue?") "," Warning!!! ", messageboxbuttons.okcancel);//It pops up as shown in the dialog box
if (dr = = DialogResult.OK)//Only press the OK button to perform the following
{
Label1. Text = "nice weather";
}
In addition to the messageboxbuttons there are several kinds of dialog boxes
Tertiary linkage
Three ComboBox
Public Form1 ()//constructor of Form1
{
InitializeComponent ();
Areadatabind (ComboBox1, "0001");
Areadatabind (ComboBox2, comboBox1.SelectedValue.ToString ());
Areadatabind (ComboBox3, comboBox2.SelectedValue.ToString ());
}
public void Areadatabind (ComboBox cb, String pcode)
{
Cb. DataSource = new Chinadata (). Select (Pcode);//Data source
Cb. DisplayMember = "AreaName";//Display value
Cb. ValueMember = "AreaCode";//Actual value
}
private void ComboBox1_SelectedIndexChanged (object sender, EventArgs e)
{
Areadatabind (ComboBox2, comboBox1.SelectedValue.ToString ());
}
private void Combobox2_selectedindexchanged (object sender, EventArgs e)
{
Areadatabind (ComboBox3, comboBox2.SelectedValue.ToString ());
}
DateTime type Comparison size:
Datetime.compare (T1,T2) compares two date size, row front small, row in the back big, for example: 2011-2-1 is less than 2012-3-2
The return value is less than 0: T1 is less than T2.
The return value equals zero: T1 equals T2.
The return value is greater than 0: T1 is greater than T2.
Buttons and level three linkage in the MessageBox