well simply i need someone to explain more about this for me
umm it's a method who takes argument of control type , for each loop to get all the controls in cc , c is umm instance from cc ?
anyway the part i cant understand over here is this one
c as checkbox ?
sorry my first time to see this , thanks in advance :(
edit : same goes for umm "Button b = c as Button;" as c isnt a button , it's an instance of cc , so we create an instance b from buttons with type c which it's type is cc which is control ? wdf o-0 lol
Code:
void AccessAll(Control.ControlCollection cc)
{
foreach (Control c in CC)
{
if (c is CheckBox)
{
CheckBox ch = c as CheckBox;
ch.Checked = true;
}
if (c.HasChildren) AccessAll(c.Controls);
}
}
anyway the part i cant understand over here is this one
he create an instance(ch) of an instance(c) as the instance c (of controls) wont have the property checked ?Quote:
CheckBox ch = c as CheckBox;
c as checkbox ?
sorry my first time to see this , thanks in advance :(
edit : same goes for umm "Button b = c as Button;" as c isnt a button , it's an instance of cc , so we create an instance b from buttons with type c which it's type is cc which is control ? wdf o-0 lol