1. Buat project baru,desain sesuai yang anda inginkan
2. disini saya menggunakan toolbox combobox1,button1,button2,dan listbox1,
3. input listing program dengan menekan 2x pada form tersebut , seperti dibawah ini:
Public Class Form4
Dim item As String
Private Sub
Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
ComboBox1.Items.Add("Umar")
ComboBox1.Items.Add("Salman")
ComboBox1.Items.Add("Halimah")
ComboBox1.Items.Add("Shafira")
End Sub
Private Sub
Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
ListBox1.Items.Add(ComboBox1.Text)
End Sub
Private Sub
Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button2.Click
ListBox1.Items.Remove(ListBox1.Text)
End Sub
Private Sub
Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button3.Click
ListBox1.Items.Clear()
End Sub
HASIL:


0 komentar:
Posting Komentar