How do i do that – Updating the content of a code behind generated button
void MakeButtonQ()
{
Button b2 = new Button();
b2.Content = Class1.Question;
b2.Height = 150;
b2.Width = 230;
b2.Background = new SolidColorBrush(Colors.White);
b2.Foreground = new SolidColorBrush(Colors.Black);
stackPanel1.Children.Add(b2);
}
I will have to update the content using code behind. Thanks in advance!
Regards,
Jonathan
Save a reference to the button in a variable and change the content using this variable.