Rhayezelle
Member
please help me with my code...
I would like to add an item to my list in the combobox when i click "others...please specify" then the combobox would be blank, and there I would type another item...
the problems are
1. when closing the form the item that has been added has not been saved with the list of the combobox
2. when I add again a new item to the list by clicking the "others...please specify" again , the previous item that I had added would be replaced by the new item.
here's my code
Public Sub formload
CmbCitizenshipItems
end sub
Public Sub CmbCitizenshipItems()
CmbCitizenship.Items.Add("Filipino")
CmbCitizenship.Items.Add("Others... please specify")
End Sub
Private Sub CmbCitizenship_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmbCitizenship.SelectedIndexChanged
If CmbCitizenship.Text = "Others... please specify" Then
CmbCitizenship.Items.Clear()
End If
End Sub
Private Sub CmbCitizenship_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles CmbCitizenship.KeyDown
If e.KeyCode = Keys.Enter Then
CmbCitizenship.Items.Clear()
CmbCitizenship.Items.Add(CmbCitizenship.Text)
CmbCitizenshipItems()
End If
End Sub
please help me...
I would like to add an item to my list in the combobox when i click "others...please specify" then the combobox would be blank, and there I would type another item...
the problems are
1. when closing the form the item that has been added has not been saved with the list of the combobox
2. when I add again a new item to the list by clicking the "others...please specify" again , the previous item that I had added would be replaced by the new item.
here's my code
Public Sub formload
CmbCitizenshipItems
end sub
Public Sub CmbCitizenshipItems()
CmbCitizenship.Items.Add("Filipino")
CmbCitizenship.Items.Add("Others... please specify")
End Sub
Private Sub CmbCitizenship_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmbCitizenship.SelectedIndexChanged
If CmbCitizenship.Text = "Others... please specify" Then
CmbCitizenship.Items.Clear()
End If
End Sub
Private Sub CmbCitizenship_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles CmbCitizenship.KeyDown
If e.KeyCode = Keys.Enter Then
CmbCitizenship.Items.Clear()
CmbCitizenship.Items.Add(CmbCitizenship.Text)
CmbCitizenshipItems()
End If
End Sub
please help me...