在Silverlight中有多种按钮控件,这些控件在Windows phone7中也都得到了很好的支持。
一.Button:这个控件只是一个基础控件,通过blend可以创建出多种效果的按钮来。
<Button Content="Button1" Height="81" HorizontalAlignment="Left" Margin="135,99,0,0" Name="button1" VerticalAlignment="Top" Width="213" Click="button1_Click" Background="Red" Foreground="Beige" BorderBrush="Yellow" BorderThickness="5" />
Click:响应点击的事件。
通过使用blend工具可以设置按钮的多种效果:
<Button Content="Button2" Height="81" HorizontalAlignment="Left" Margin="135,237,0,0" x:Name="button2" VerticalAlignment="Top" Width="213" Foreground="Beige" BorderBrush="Yellow" BorderThickness="5" >
<Button.Background>
<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
<GradientStop Color="#FFF9F9F9" Offset="0.543"/>
<GradientStop Color="#FFF90808" Offset="0.996"/>
<GradientStop Color="Red" Offset="0.03"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<Button Content="Button3" Height="81" HorizontalAlignment="Left" Margin="135,394,0,0" x:Name="button3" VerticalAlignment="Top" Width="213" Foreground="Beige" BorderBrush="Yellow" BorderThickness="5" ClickMode="Press" >
<Button.Background>
<ImageBrush ImageSource="/Chrysanthemum.jpg" Stretch="UniformToFill"/>
</Button.Background>
</Button>
开发(十三.二 按钮控件)-jqueryphone 返回按钮">