A
Anthony P.
Hello Everyone,
Simple question, I'm sure, but I can't find the answer to it. So if I
want to loop through every single control on a form, I use this code:
Dim ctrl as Control
For Each ctrl on frmMain
....
Next ctrl
But I need to do something a little different and I can't quite figure
out how to do it. I have several checkboxes on the form and most,
except one, are exclusive of all others so that when one is checked
the others can't be. So I need to loop through ONLY the checkboxes on
the form and disable all of them except the current one checked (which
I know I can find through an if ctrl.text = yadda yadda statement.
The thing is I need to fire this action every time ANY checkbox is
checked and I think it's wasteful to include the same code over and
over for the checked/unchecked methods of every checkbox.
My questions are these:
1. How do I look ONLY through controls of a certain type (i.e.
checkboxes)
and
2. How do I make one method that fires for ALL checkboxes when they
are checked?
Thanks in advance!
Anthony
Simple question, I'm sure, but I can't find the answer to it. So if I
want to loop through every single control on a form, I use this code:
Dim ctrl as Control
For Each ctrl on frmMain
....
Next ctrl
But I need to do something a little different and I can't quite figure
out how to do it. I have several checkboxes on the form and most,
except one, are exclusive of all others so that when one is checked
the others can't be. So I need to loop through ONLY the checkboxes on
the form and disable all of them except the current one checked (which
I know I can find through an if ctrl.text = yadda yadda statement.
The thing is I need to fire this action every time ANY checkbox is
checked and I think it's wasteful to include the same code over and
over for the checked/unchecked methods of every checkbox.
My questions are these:
1. How do I look ONLY through controls of a certain type (i.e.
checkboxes)
and
2. How do I make one method that fires for ALL checkboxes when they
are checked?
Thanks in advance!
Anthony