AverageWriter
Member
- Joined
- Dec 30, 2021
- Messages
- 10
- Programming Experience
- Beginner
Good afternoon all.
Given that I'm not all that smart, I've found myself stumped again.
So, to condense the project down, at the moment, there are four radio buttons. Each one is set to alter a public variable called "backgroundLayer" to a number from 0 to 4, depending on which button is clicked.
There are four text boxes, each one called BackgroundText 1, 2, 3 and 4.
So normally, to put something in them, one would set, for example, BackgroundText1.Text to a value.
Now, the amount of code that occurs to create the output is rather substantial. To avoid duplicating it multiple times, it would be preferable to use the value of that "backgroundLayer" variable and append it to "BackgroundText" and finally add ".Text", creating the full reference, ie (BackgroundText4.Text).
I've searched through the developer references and scoured Google, but I still can't figure out the best way to do this.
Given that I'm not all that smart, I've found myself stumped again.
So, to condense the project down, at the moment, there are four radio buttons. Each one is set to alter a public variable called "backgroundLayer" to a number from 0 to 4, depending on which button is clicked.
There are four text boxes, each one called BackgroundText 1, 2, 3 and 4.
So normally, to put something in them, one would set, for example, BackgroundText1.Text to a value.
Now, the amount of code that occurs to create the output is rather substantial. To avoid duplicating it multiple times, it would be preferable to use the value of that "backgroundLayer" variable and append it to "BackgroundText" and finally add ".Text", creating the full reference, ie (BackgroundText4.Text).
I've searched through the developer references and scoured Google, but I still can't figure out the best way to do this.