What's new

Check box help

  • Thread starter xA13x
  • Start date
  • Views 591
X

xA13x

Newbie
Messages
78
Reaction score
0
Points
45
Sin$
0
1. I have multiple check boxs and i would like it so when i check them my certain text comes up for example


If cb1.Checked = TrueThen
rtb2.Text = "[YES]"
EndIf

well i did this with all my check boxes some no some yes and it only gives me the text i last checked so i i checked yes it would show yes in the text box.so how do i make it so all my yes's and no's are abel to be in my text box

also how do i make it so when one is checked another cant be i think i no just wana make sure something like

If cb1.checked=true then
cb2.checked=false
 
Spanky McTrolly

Spanky McTrolly

Enthusiast
Messages
378
Reaction score
64
Points
95
Sin$
0
Try this

If chkBox1.value = True then
lblText1.text = True
lblText2.text = False
lblText3.text = False
'ect....
End if

If chkBox2.value = True then
lblText1.text = False
lblText2.text = True
lblText3.text = False
'ect...
End if

Im not sure if i fully understand your question though... But i hope this helps^_^
 
D

Dem Pyros

Guest
no idea what you're talking about really......

do you know how to use "and" in the if statement?
 
Spanky McTrolly

Spanky McTrolly

Enthusiast
Messages
378
Reaction score
64
Points
95
Sin$
0
If chkbox1.value = true And chkBox2.value = true Then
textbox.text = "Both are checked!!"
End if


In this case both conditions have to be true. So one check box, and the other have to be checked for the code <textbox.text = "Both are checked"> to be executed. If they both arent true, then, it will just do nothing. Unless you use an "Else if" statement---------

If chkbox1.value = true And chkBox2.value = true Then
textbox.text = "Both are checked!!"
Else
Unload me

End if


So with the above code, if one box is check and the other isnt, then the program will exit when a command button is pressed. Hope your following me! If you would like to talk on AIM my s/n is FireCrotch757
 
X

xA13x

Newbie
Messages
78
Reaction score
0
Points
45
Sin$
0
okay i got a really good exaple said i ws making a Forum mod poster mmk and when someone checked the yes box to AI and then NO to map skins then in a text box below it would put the AI YES and MAP SKIN NO get it?
 
D

Dem Pyros

Guest
then do "elseif" statements. Or better yet if you just want it to print out a sentence then say if number1 = yes then print blah blah blah, and put a comma after what you tell it to print, and then add to that line.
 
X

xA13x

Newbie
Messages
78
Reaction score
0
Points
45
Sin$
0
still not helping i use this code in the checkbox code


If
cb1.Checked = True Then
rtb2.Text = "[No] AI injection"
End If

then this in my second check box code

If cb3.Checked = True Then
rtb2.Text = "[YES] Lighting Mods"
End If

etc...

but when i run it and click more then 2 things only one comes up in my rich text box so more clear i check 1 box in my text box it says [yes] ai blablabla if i check too it only says the last one i checked

 
D

Dem Pyros

Guest
xA13x said:
still not helping i use this code in the checkbox code


If
cb1.Checked = TrueThen
rtb2.Text = "[No] AI injection"
EndIf

then this in my second check box code

If cb3.Checked = TrueThen
rtb2.Text = "[YES] Lighting Mods"
EndIf

etc...

but when i run it and click more then 2 things only one comes up in my rich text box so more clear i check 1 box in my text box it says [yes] ai blablabla if i check too it only says the last one i checked


Use this then.

Code:
Private Sub Whatever
Dim AIInjection as string
Dim LightingMods As String

If cb1.Checked = TrueThen
AIInjection = "[No] AI injection "
EndIf

If cb3.Checked = TrueThen
LightingMods = "[YES] Lighting Mods"
EndIf

rtb2.Text = AIInjection + LightingMods

 
X

xA13x

Newbie
Messages
78
Reaction score
0
Points
45
Sin$
0
mmk ill give the person 2nothings if they add me on msn and do that for me cause im hella lazy lolz j.k. sweet ill just see if this works and that works for differnt subs?
 
X

xA13x

Newbie
Messages
78
Reaction score
0
Points
45
Sin$
0
okayy so you no how it says rtb2.Text = AIInjection + LightingMods what would i change that to

ps i have like 13 check boxs so i dont wana be constently posting here asking wtf is wrong.
 
D

Dem Pyros

Guest
xA13x said:
okayy so you no how it says rtb2.Text = AIInjection + LightingMods what would i change that to

ps i have like 13 check boxs so i dont wana be constently posting here asking wtf is wrong.
Read the code.......

you have the textbox add the two strings. adding a string that's blank, doesn't add any text at all.

so make it add all of the strings, (string 1 + string2 + string 3.....)
 
X

xA13x

Newbie
Messages
78
Reaction score
0
Points
45
Sin$
0
mmkk i get it also do you or spanky mctrolly have msn cause id like to add you so i dont have to keep posting here cause to me statring to be like spam lolz
 
Top Bottom
Login
Register