Button button2 = new Button { Width=30,Height=30, Content="HelloWorld", Background=new SolidColorBrush(Colors.Black) }; this.gdAA.Children.Add(button2);