'used stuffs :- list1 and its two arrays(0,1)
'displaying name along with its index of the selected control
Private Sub List1_Click(Index As Integer)
MsgBox List1(Index).Name & "(" & Index & ")"
End Sub
'dynamically adding items to all listboxes present on the current form
Private Sub Form_Load()
Dim ctlControl As Object
On Error Resume Next
For Each ctlControl In Me.Controls
If TypeOf ctlControl Is ListBox Then
ctlControl.AddItem "computer"
DoEvents
End If
Next ctlControl
End Sub
thanks choudhuryshouvi it really works..thank you so much
Reputation Points: 19
Solved Threads: 115
Nearly a Posting Virtuoso
Offline 1,317 posts
since Apr 2007