Hello,
Intro:
As I am missing my old Control Array functionality (its just not as good in .Net in my opinion) I am trying to find a workaround. I have seen the MS suggested way of creating "control arrays" at run time and I prefer the old design time way.
Question:
Is there a way to change a control's property given that you have the control's name in a string variable? For example, through other methods in my function I can find the "Index" calling my event handler for the array. Let's say I have 3 buttons cmd1, cmd2, cmd3 and 3 textboxes text1, text2 and text3.
I want the textbox to read "Hello" when its correspnding button is clicked.
By parsing the last digit of sender.name in a event handler for the buttons I can get my "index". Let's say, button 3 is pressed. I parse sender.name, and get "3". I can then easily set a string to "textbox" & "3".
So now I have a string with a value of "textbox3". How can I take that and set textbox3.Text = "Hello"?
Thanks.
Spektre
Intro:
As I am missing my old Control Array functionality (its just not as good in .Net in my opinion) I am trying to find a workaround. I have seen the MS suggested way of creating "control arrays" at run time and I prefer the old design time way.
Question:
Is there a way to change a control's property given that you have the control's name in a string variable? For example, through other methods in my function I can find the "Index" calling my event handler for the array. Let's say I have 3 buttons cmd1, cmd2, cmd3 and 3 textboxes text1, text2 and text3.
I want the textbox to read "Hello" when its correspnding button is clicked.
By parsing the last digit of sender.name in a event handler for the buttons I can get my "index". Let's say, button 3 is pressed. I parse sender.name, and get "3". I can then easily set a string to "textbox" & "3".
So now I have a string with a value of "textbox3". How can I take that and set textbox3.Text = "Hello"?
Thanks.
Spektre