Thread: Menu problems
View Single Post
  #3 (permalink)  
Old 09-15-06, 07:06 AM
Keithuk's Avatar
Keithuk Keithuk is offline
Newbie Coder
 
Join Date: Sep 2004
Location: Staffordshire, England
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
Well because its a control array you can use a For/Next loop to remove all check marks then just check the selected Index.
Code:
Private Sub menu_Click(Index As Integer)

Dim N As Integer

'Find the Lower and Upper Index value
For N = LBound(menu) To UBound(menu)
     menu(N).Checked = False
Next
menu(Index).Checked = True

End sub
I don't have VB on my comp at work so I can't try it. Providing LBound and UBound return values it should work.
__________________
I've been programming with VB for 13 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

http://www.martin2k.co.uk/forums/
Reply With Quote