Rectangle Button


 

      <Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">

            <Button.Content>

                <Rectangle Height="40" Width="40" Fill="Black" />

            </Button.Content>

        </Button>

 

 

 

           System.Windows.Controls.Button button = new System.Windows.Controls.Button();

            System.Windows.Shapes.Rectangle r = new Rectangle();

            r.Width = 40;

            r.Height = 40;

            r.Fill = System.Windows.Media.Brushes.Black;

            button.Content = r;

           this.Content = button;
 

 

 

posted @ 2011-11-24 20:02  quietwalk  阅读(257)  评论(0编辑  收藏  举报