David W

David W

  • NA
  • 183
  • 650

Changing button text with a string.

Jun 24 2015 12:31 PM
Hello All,
 
 
     My question feels like it should be simple yet is proving to be a bit annoying for me.  I am working on a program right now and all seems to be well up until this point.  Here is a short breakdown of what I am running into.
 
I have a string (named button_sent_number) which collects info on which button was clicked and gives it a number.
 
I have several buttons (named home_01_button to home_20_button) that I need changed on each click.
 
I have a string (named button_name_new) that collects a name from a text box (named name_new_textbox)
 
What I am attempting to do is change the button through a function with the number provided by button_sent_number.
 
 
Example : home_01_button is clicked.  The string, button_sent_number, is assigned 01.  Button one has text that needs to be changed to 01 (which was provided by button_sent_number).
 
 
A way that might explain what I have tried :
 
home_ + button_sent_number + _button.Content = button_name_new;
 
 
Is there something I am missing here? 

Answers (1)