how to make a select all button for checkboxes

Posts 1–6 of 6 · Page 1 of 1
how to make a select all button for checkboxes
Well i have 6 checkboxes.
I want to make a button/another checkbox thats says select all and it selects them all.
Wats the code?

Thanks,
acid_buRn
Code:
If CheckBox7.Checked = True Then
CheckBox1.Checked = True 
CheckBox2.Checked = True 
CheckBox3.Checked = True 
CheckBox4.Checked = True 
CheckBox5.Checked = True 
CheckBox6.Checked = True
Else
 CheckBox1.Checked = False
CheckBox2.Checked = False
CheckBox3.Checked = False
CheckBox4.Checked = False
CheckBox5.Checked = False
CheckBox6.Checked = False
CheckBox7 is the Checkbox you use to check all the other boxes
lol iknow that.
Thought there would have been an easier code.
CBF typing all that up lol

thanks anyway
then do:
Code:
If CheckBox7.Checked = True Then
Check(True)
elseif checkbox7.checked = false then
check(false)
end if

sub check(tof as string)
checkbox1.checked = tof
checkbox2.checked = tof
checkBox3.checked = tof
checkBox4.checked = tof
checkBox5.checked = tof
checkBox6.checked = tof

end sub
or, even more complicated:

Code:
If CheckBox7.Checked = True Then
Check(True)
elseif checkbox7.checked = false then
check(false)
end if

sub check(tof as string)
dim num as integer = 1
while num <> 7
     checkbox + num.checked = tof
     num += 1
End While
End Sub
or something similar

Side note: MISA CAMPO IS SEXY. idk why that huge ass nose is soo attractive.
Quote Originally Posted by gwentravolta View Post
then do:
Code:
If CheckBox7.Checked = True Then
Check(True)
elseif checkbox7.checked = false then
check(false)
end if

sub check(tof as string)
checkbox1.checked = tof
checkbox2.checked = tof
checkBox3.checked = tof
checkBox4.checked = tof
checkBox5.checked = tof
checkBox6.checked = tof

end sub
or, even more complicated:

Code:
If CheckBox7.Checked = True Then
Check(True)
elseif checkbox7.checked = false then
check(false)
end if

sub check(tof as string)
dim num as integer = 1
while num <> 7
     checkbox + num.checked = tof
     num += 1
End While
End Sub
or something similar

Side note: MISA CAMPO IS SEXY. idk why that huge ass nose is soo attractive.
too complicated for me lolz.
Ill stick with the easier/longer code
Code:
If CheckBox7.Checked = True Then ' Check All Box
CheckBox1.Checked = True 
CheckBox2.Checked = True 
CheckBox3.Checked = True 
CheckBox4.Checked = True 
CheckBox5.Checked = True 
CheckBox6.Checked = True
CheckBox7.Enabled = False
CheckBox8.Enabled = True
Else
CheckBox8.Checked = True Then ' Uncheck all box
CheckBox1.Checked = False
CheckBox2.Checked = False
CheckBox3.Checked = False
CheckBox4.Checked = False
CheckBox5.Checked = False
CheckBox6.Checked = False
CheckBox7.Enabled = True
CheckBox8.Enabled = False
that is the code for a check all/uncheck all option
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us