vb中Form窗体有一个文本框,一个列表框,一个命令按钮,两个单选按钮,代码怎么写
展开全部
'Made by xkwy.
Private Sub Command1_Click()
List1.AddItem Text1.Text
End Sub
Private Sub List1_Click()
Text1.Text = List1.List(List1.ListIndex)
End Sub
Private Sub Option1_Click()
If List1.ListIndex < 0 Then MsgBox "You have not select item!", vbCritical
List1.RemoveItem List1.ListIndex
End Sub
Private Sub Option2_Click()
If List1.ListIndex < 0 Then MsgBox "You have not select item!", vbCritical
List1.List(List1.ListIndex) = Text1.Text
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询