Private Sub Combo1_Click()
Combo2.ListIndex = Combo1.ListIndex
End Sub
Private Sub Combo2_Click()
Combo1.ListIndex = Combo2.ListIndex
End Sub
Private Sub Command1_Click()
Combo1.AddItem (Combo1.Text)
Combo2.AddItem (Combo2.Text)
Combo1.Text = ""
Combo2.Text = ""
'以上2行使保存后清零,避免重复保存,同时方便下次输入
End Sub
Private Sub Command2_Click()
Combo1.RemoveItem (Combo1.ListIndex)
Combo2.RemoveItem (Combo2.ListIndex)
Combo1.Text = ""
Combo2.Text = ""
End Sub
另外可以加一些在保存前避免保存零长度文本(内容空白)之类的代码,恕不赘述。
温馨提示:内容为网友见解,仅供参考