[Help]CheckBoxes[solved]

Posts 1–7 of 7 · Page 1 of 1
[Help]CheckBoxes[solved]
Lets say you have 3 Checkboxes. How do you make it so only 1 can be checked, and only one HAS to be checked?
Quote Originally Posted by user782106 View Post
RadioButtons lol
I kinda wanted checkboxes, but i guess it will do.
Code:
If checkbox1.checked = true then
Checkbox1.checked = false
Elseif checkbox2.checked = true then
Checkbox2.checked = false
End if
You're telling me you couldn't write that yourself? Cmon. I did that on my iPod touch and I have 100% guarantee that it will work.
Or:

[highlight=vb.net]
Checkbox1.Checked = Not CheckBox1.Checked
Checkbox2.Checked = Not CheckBox2.Checked
[/highlight]

But what ever, I'm going to mark this solved.
Quote Originally Posted by user782106 View Post
Code:
If checkbox1.checked = true then
Checkbox1.checked = false
Elseif checkbox2.checked = true then
Checkbox2.checked = false
End if
You're telling me you couldn't write that yourself? Cmon. I did that on my iPod touch and I have 100% guarantee that it will work.
Er. I could, but, i didnt think of it like that.

Also, i said 3 check boxes o.o

Quote Originally Posted by Jason View Post
Or:

[highlight=vb.net]
Checkbox1.Checked = Not CheckBox1.Checked
Checkbox2.Checked = Not CheckBox2.Checked
[/highlight]

But what ever, I'm going to mark this solved.
Nice, you always do things the more advance way...

And yeah, ill just add

Code:
Checkbox1.Checked = Not CheckBox1.Checked
Checkbox2.Checked = Not CheckBox2.Checked
Checkbox3.Checked = Not CheckBox3.Checked
Also, when i copy the code when you use 'highlight=vb.net', it copys all in one line...
Well CheckBox1.Checked = A boolean (true or false) Not just means opposite of whatever boolean you're comparing to.

I.e

If Not True

is the same as saying If False

So if CheckBox1.Checked = True then
Not CheckBox1.Checked = False.

Etc etc,
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Talk with us