Check Box Control Array Problem

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2009
Posts: 13
Reputation: Ravi Kant is an unknown quantity at this point 
Solved Threads: 1
Ravi Kant's Avatar
Ravi Kant Ravi Kant is offline Offline
Newbie Poster

Check Box Control Array Problem

 
0
  #1
Apr 8th, 2009
Private Sub Check1_Click()
If Check2.Value = 1 Then Check2.Value = 0
If Check3.Value = 1 Then Check3.Value = 0
If Check4.Value = 1 Then Check4.Value = 0
If Check5.Value = 1 Then Check5.Value = 0
If Check1.Value = 1 Then Text1.Text = Check1.Caption
If Check1.Value = 0 Then Text1.Text = ""
End Sub


I want to do the same with control Array :

My Code :

If Check1(Index) Then
Text1.Text = Check1(Index).Caption
Else
For k = 0 To Check1.Count
Text1.Text = ""
Check1(i).Value = 0
Next
End If

But I can not get the same result with this code. Plz help.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 912
Reputation: vb5prgrmr will become famous soon enough vb5prgrmr will become famous soon enough 
Solved Threads: 167
vb5prgrmr vb5prgrmr is offline Offline
Posting Shark

Re: Check Box Control Array Problem

 
0
  #2
Apr 8th, 2009
You can save yourself a lot of time and code by using an array of option buttons instead of check boxes...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Option1_Click(Index As Integer)
  2. Text1.Text = Option1(Index).Caption
  3. End Sub
and that is all the code you need...

Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.

Thanks
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 441 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC