❔ Is it possible to use a variable name in an object call?
Forgive me if I worded it wrong(that is probably part of the problem of why I can't find information on this), but I want to know if this is possible, and if so, how.
Example:
I have 4 textboxes: StrengthTextbox, DexterityTextbox, VitalityTextbox, FocusTextbox
I am making a calculator for skills in a game, and these skills can be based on any of these 4 attributes(using them in their equations)
Is there some kind of way where I can call these textboxes in a way like... attribute + Textbox.Text?
6 Replies
call what
the value from the textboxes
these skills can use 1 value from any 4 of these textboxes
I am trying to figure out if I can make the textbox reference use a variable, so I can cut 4 checks into 1
by simply swapping out the first half of the textbox name, but I don't know how to do it/if it's possible
maybe it would be simpler if I asked
how can I make this
"Strength" + Textbox.Text
work like this
StrengthTextbox.Text
you cant do that without reflection
just use each name normally
sad
well thanks anyway
or put them in a collection
depends really
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.