VB combo1.listindex 问题
PrivateSubForm_Load()DimIAsIntegerEndSubPrivateSubCombo1_LostFocus()SelectCaseCombo1....
Private Sub Form_Load()
Dim I As Integer
End Sub
Private Sub Combo1_LostFocus()
Select Case Combo1.ListIndex = I
Case I = 0
Text1.Text = "a"
Case I = 1
Text1.Text = "b"
Case I = 2
Text1.Text = "c"
Case I = 3
Text1.Text = "d"
End Select
End Sub
运行后为什么只有上边两个能运行,后边的就不对了。
主要是C。和D运行不出来。。。。 展开
Dim I As Integer
End Sub
Private Sub Combo1_LostFocus()
Select Case Combo1.ListIndex = I
Case I = 0
Text1.Text = "a"
Case I = 1
Text1.Text = "b"
Case I = 2
Text1.Text = "c"
Case I = 3
Text1.Text = "d"
End Select
End Sub
运行后为什么只有上边两个能运行,后边的就不对了。
主要是C。和D运行不出来。。。。 展开
3个回答
展开全部
把你上边的代码删掉,改成下面的
Private Sub Combo1_Click()
Select Case Combo1.ListIndex
Case 0
Text1.Text = "a"
Case 1
Text1.Text = "b"
Case 2
Text1.Text = "c"
Case 3
Text1.Text = "d"
End Select
End Sub
Private Sub Combo1_Click()
Select Case Combo1.ListIndex
Case 0
Text1.Text = "a"
Case 1
Text1.Text = "b"
Case 2
Text1.Text = "c"
Case 3
Text1.Text = "d"
End Select
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
改为这样
Private Sub Combo1_LostFocus()
Select Case Combo1.ListIndex
Case Is = 0
Text1.Text = "a"
Case Is = 1
Text1.Text = "b"
Case Is = 2
Text1.Text = "c"
Case Is = 3
Text1.Text = "d"
End Select
End Sub
Private Sub Combo1_LostFocus()
Select Case Combo1.ListIndex
Case Is = 0
Text1.Text = "a"
Case Is = 1
Text1.Text = "b"
Case Is = 2
Text1.Text = "c"
Case Is = 3
Text1.Text = "d"
End Select
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Public i As Integer
Private Sub Form_Load()
'Dim I As Integer
End Sub
Private Sub Combo1_LostFocus()
Select Case Combo1.ListIndex = i
Case i = 0
Text1.Text = "a"
Case i = 1
Text1.Text = "b"
Case i = 2
Text1.Text = "c"
Case i = 3
Text1.Text = "d"
End Select
End Sub
Private Sub Form_Load()
'Dim I As Integer
End Sub
Private Sub Combo1_LostFocus()
Select Case Combo1.ListIndex = i
Case i = 0
Text1.Text = "a"
Case i = 1
Text1.Text = "b"
Case i = 2
Text1.Text = "c"
Case i = 3
Text1.Text = "d"
End Select
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询