//Type #1: button with solid red background
Button btn = new Button();
Border red = new Border();
TextBlock text = new TextBlock();
text.Text = "runtime Button";
red.Background = new SolidColorBrush(Colors.Red);
red.Child = text;
btn.Content = red;
LayoutRoot.Children.Add(btn);
//Type #2: button with some gradient effects of the button showing through
Button btn = new Button();
Grid grd = new Grid();
Border red = new Border();
TextBlock text = new TextBlock();
text.Text = "runtime Button";
red.Background = new SolidColorBrush(Colors.Red);
red.Opacity = 0.7;
grd.Children.Add(red);
grd.Children.Add(text);
btn.Content = grd;
LayoutRoot.Children.Add(btn);
|