1. buka visual studio
2. pilih new project
3. persiapkan komponen tersebut :
item jumlah
1. Groupbox 1
2. textbox 2
3. Label 3
4. Combo box 1
5. button 3
4. setelah persiapan selesai maka kita masuk ke coding, double klik pada form lalu masukan script.
private void Form1_Load(object sender, EventArgs e) { comboBox1.Items.Add("Dra."); comboBox1.Items.Add("Drs."); comboBox1.Items.Add("Ir."); comboBox1.Items.Add("Dr."); comboBox1.Focus(); } |
private void button1_Click(object sender, EventArgs e) { listBox1.Items.Add(comboBox1.Text + " " + textBox1.Text + " " + textBox2.Text); textBox1.Text = ""; textBox2.Text = ""; comboBox1.Text = ""; comboBox1.Focus(); } |
private void button2_Click(object sender, EventArgs e) { listBox1.Items.Clear(); comboBox1.Focus(); } |
private void button3_Click(object sender, EventArgs e) { this.dispose(); } |
{ 0 komentar... Views All / Send Comment! }
Posting Komentar