|
-
May 15th, 2006, 01:22 AM
#1
Thread Starter
Lively Member
[RESOLVED] Checkboxes Caption Display in string
hi all,
supposely, i have 10 checkboxes in VB. user can check any number of checkboxes. i like to display the caption of the checked checkboxes with semi-colon ( in between each caption in a single string or messagebox. how to i do it? can someone help me with the codes?
longwar
Last edited by Hack; May 15th, 2006 at 07:27 AM.
Reason: Added [RESOLVED] to thread title and green "resolved" checkmark
-
May 15th, 2006, 01:58 AM
#2
Re: Checkboxes Caption Display in string
Private Sub Check1_Click()
MsgBox "'" + Check1.Caption + "'", vbInformation
End Sub
-
May 15th, 2006, 02:03 AM
#3
Addicted Member
Re: Checkboxes Caption Display in string
To make this easier make all your checkboxes the same name with a index 0 to 9. Goto your properties window to do this.
VB Code:
Dim i As Integer
Dim str As String
For i% = 0 to 9 'or 1 to 10
If chk(i%).Value = 1 Then 'value is true
str$ = str$ & " ; " & chk(i%).Caption
End If
Next i%
Me.Caption = str$
Put this code in the Checkbox
I don't know if this is what you meant, but I hope it is.
-
May 15th, 2006, 03:35 AM
#4
Thread Starter
Lively Member
Re: Checkboxes Caption Display in string
thks XRsTX. u got what i mean. thks alot
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|