Not sure how to phrase this....
-
I have a string variable which contains the name of a textbox whose text I want to get/use. How can I I create a textbox object from my variable and get the text? Thanks! -Steve
Reflection.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Reflection.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
If i didn't know how to phrase it for a forum, how would i know how to phrase it for a search engine? Useful keywords would have helped more than a post on how to use Google.
I'm sorry. I'm sorry you're so stupid. The link to google is, in fact, my sig block. My answer was actually one word. Reflection. Google reflection and you'll drown in examples on how to do what you want.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
If i didn't know how to phrase it for a forum, how would i know how to phrase it for a search engine? Useful keywords would have helped more than a post on how to use Google.
svanwass wrote:
If i didn't know how to phrase it for a forum, how would i know how to phrase it for a search engine?
Chill, dude. When in doubt, explain what you're actually trying to do - not how you think you're gonna do it. And ask follow-up questions.
Citizen 20.1.01
'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
-
I have a string variable which contains the name of a textbox whose text I want to get/use. How can I I create a textbox object from my variable and get the text? Thanks! -Steve
-
I have a string variable which contains the name of a textbox whose text I want to get/use. How can I I create a textbox object from my variable and get the text? Thanks! -Steve
The solution has already been suggested, but whenever you need reflection to do something, you are either doing something quite advanced, or you are doing something backwards... Why is it that you have a name of a textbox, instead of a reference to it? What is it that you are trying to accomplish really?
Despite everything, the person most likely to be fooling you next is yourself.
-
Reflection.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
The solution has already been suggested, but whenever you need reflection to do something, you are either doing something quite advanced, or you are doing something backwards... Why is it that you have a name of a textbox, instead of a reference to it? What is it that you are trying to accomplish really?
Despite everything, the person most likely to be fooling you next is yourself.
My program connects to a database which populates a bunch of text boxes. I then unlock them and allow the user to edit the contents. A write button is pressed and the contents of the current text boxes are stored in an array and compared to the original database read (stored in a different array) to determine what has been changed. The position at which a change is found is store in another array. These positions correlates to another array that stores the names of the text boxes. The step i am missing is to take that stored text box name and get the real text boxes text.
-
My program connects to a database which populates a bunch of text boxes. I then unlock them and allow the user to edit the contents. A write button is pressed and the contents of the current text boxes are stored in an array and compared to the original database read (stored in a different array) to determine what has been changed. The position at which a change is found is store in another array. These positions correlates to another array that stores the names of the text boxes. The step i am missing is to take that stored text box name and get the real text boxes text.
...so that you can then store the changed values in the database? But don't you already have the values? Isn't the position of a changed text item also the index of the array that you first used, when the user clicks the Write button, to store what was in the text boxes? Why read from the text boxes when you can read from your array's copy of the text boxes?