there are 64 buttons(button1 ,button2....but ton64).
Also a textbox and button "ok ".
when 15 is entered into the textbox and clicked ok Backcolcor of button15 shauold change to red;
my Approach is
1.valve entered is passed to i
2.then using while loop i change the back color to red
while(i==15)
{button15.Backc olor=Color.red;
}
Above approach works but needs 64 while loops and that makes the code lenghty.
is there any method to reduce the code
i want to know wheather i can use "button"+i.tost ring(); here to reduce the code
Also a textbox and button "ok ".
when 15 is entered into the textbox and clicked ok Backcolcor of button15 shauold change to red;
my Approach is
1.valve entered is passed to i
2.then using while loop i change the back color to red
while(i==15)
{button15.Backc olor=Color.red;
}
Above approach works but needs 64 while loops and that makes the code lenghty.
is there any method to reduce the code
i want to know wheather i can use "button"+i.tost ring(); here to reduce the code
Comment