关于vb listbox
求高手解释IfList1.ListIndex>=0Thenn=InStr(List1.Text,"")l=Len(List1.Text)n=n+1Label11.Capt...
求高手解释
If List1.ListIndex >= 0 Then
n = InStr(List1.Text, " ")
l = Len(List1.Text)
n = n + 1
Label11.Caption = Val(Label11.Caption) - Val(Mid(List1.Text, n, l - n)) 展开
If List1.ListIndex >= 0 Then
n = InStr(List1.Text, " ")
l = Len(List1.Text)
n = n + 1
Label11.Caption = Val(Label11.Caption) - Val(Mid(List1.Text, n, l - n)) 展开
展开全部
Private Sub List1_DblClick()
Dim i As Long
Dim s As String
If List1.ListIndex > -1 Then
s = List1.List(List1.ListIndex)
If List2.ListCount > 0 Then
For i = 0 To List2.ListCount - 1
If s = List2.List(i) Then
MsgBox "已经选过了。", vbOKCancel, "提示"
Exit For
End If
Next i
If i = List2.ListCount Then List2.AddItem s
Else
List2.AddItem s
End If
End If
End Sub
Private Sub Form_Load()
Dim i As Long
For i = 1 To 5
List1.AddItem "菜单" & i
Next i
End Sub
Dim i As Long
Dim s As String
If List1.ListIndex > -1 Then
s = List1.List(List1.ListIndex)
If List2.ListCount > 0 Then
For i = 0 To List2.ListCount - 1
If s = List2.List(i) Then
MsgBox "已经选过了。", vbOKCancel, "提示"
Exit For
End If
Next i
If i = List2.ListCount Then List2.AddItem s
Else
List2.AddItem s
End If
End If
End Sub
Private Sub Form_Load()
Dim i As Long
For i = 1 To 5
List1.AddItem "菜单" & i
Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询