All text changes are all changed in the Text property!
ComboBox: Click the small arrow at the top right to select the Edit item popup:
The Radiobutton:,checked property selects true to indicate that it has been selected;
Button: In the design, double-click the buttons to jump to the code area, the code will add the following code:
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespace_6 A simple control _ KFC order Meal { Public Partial classForm1:form { PublicForm1 () {InitializeComponent (); //Staple Food Index defaults to 0Combobox1.selectedindex =0; } Private voidForm1_Load (Objectsender, EventArgs e) { } Private voidRadiobutton1_checkedchanged (Objectsender, EventArgs e) { } Private voidRadiobutton3_checkedchanged (Objectsender, EventArgs e) { } Private voidButton1_Click (Objectsender, EventArgs e) { //Select Staple stringZS =comboBox1.SelectedItem.ToString (); //Choose a dish stringPc=""; if(radiobutton1.checked)//the fries are selected.PC ="French Fries"; Else if(radiobutton2.checked)//the potatoes are selected.Pc="Potato Puree"; Else//The corn sticks are selected.PC ="Corn Sticks"; //Choose a Drink stringYP =""; if(checkbox1.checked)//check Coke .{YP+=Checkbox1.text; if(checkbox2.checked)//check Coke, coffee{YP=yp +","+Checkbox2.text; if(checkbox3.checked)//check Coke, coffee, orange juice.{YP=yp+","+Checkbox3.text; } } if(checkbox3.checked)//check Coke, orange juice.{YP= YP +","+Checkbox3.text; } } Else if(checkbox2.checked)//Select Coffee{YP+=Checkbox2.text; if(checkbox3.checked)//Select Coffee, orange juice{YP=yp+","+Checkbox3.text; } } Else//only orange juice is selected .{YP+=Checkbox3.text; } //Get Address stringDZ =TextBox1.Text; //Get the phone stringDH =TextBox2.Text; //pop-up message boxMessageBox.Show ("The staple you choose is:"+zs+"\ n The matching dish is:"+pc+"\ n drinks are:"+yp+"\ n Shipping Address:"+dz+"\ n Contact information:"+DH); } }}
Click on the Order popup:
Button,checkbox,lable,radiobutton,combobox,textbox use of six simple controls