| | |
Check Box Control Array Problem
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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.
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.
•
•
Join Date: Mar 2009
Posts: 904
Reputation:
Solved Threads: 167
You can save yourself a lot of time and code by using an array of option buttons instead of check boxes...
and that is all the code you need...
Good Luck
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Option1_Click(Index As Integer) Text1.Text = Option1(Index).Caption End Sub
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
![]() |
Similar Threads
- some problem with checkbox and textbox (Visual Basic 4 / 5 / 6)
- Validate Selected Checkboxes (PHP)
- Urgent Pls Help: My codes are in errors! (C++)
- Urgent: I need Help in c++.net! (ASP.NET)
- retrieving ids from dynamically created controls in asp.net (ASP)
- Highjack file Ie wont download (Viruses, Spyware and other Nasties)
- Pop3 Mail Watcher (Part 1) (Visual Basic 4 / 5 / 6)
- not-a-virusadware (Viruses, Spyware and other Nasties)
- How to be Crash Free (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Create DSN at Run time
- Next Thread: Form1.Show - is it a method?
Views: 440 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





