I have two list boxes(left and right) and a button to send all the items in the left to right when i press it. I wanted to know how do i disable this button when the left contains no items.
I use this code for button
Private Sub AddAll_Click()
Dim strItems As String
Dim intItem As Integer
For intItem = 0 To lstLeft.ListCount - 1
strItems = strItems & lstLeft.Column(0, intItem) & ";"
Next intItem
Call FillList(LstRight, strItems)
Call FillList(lstLeft, ""
If (lstLeft.ListCount = 0) Then
AddAll.Enabled = False
End If
End Sub
Error message is i cannot use Addall.enabled property in side the onclick function
I use this code for button
Private Sub AddAll_Click()
Dim strItems As String
Dim intItem As Integer
For intItem = 0 To lstLeft.ListCount - 1
strItems = strItems & lstLeft.Column(0, intItem) & ";"
Next intItem
Call FillList(LstRight, strItems)
Call FillList(lstLeft, ""
If (lstLeft.ListCount = 0) Then
AddAll.Enabled = False
End If
End Sub
Error message is i cannot use Addall.enabled property in side the onclick function