日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

【飞秋】一起学Windows Phone7开发(十三.二 按钮控件)

發布時間:2025/3/15 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【飞秋】一起学Windows Phone7开发(十三.二 按钮控件) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

在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>

?


?

二.HyperlinkButton: 超鏈接按鈕,這個和silverlight有明顯的區別,在wp7中是不能navigate到web的。

<HyperlinkButton Content="HyperlinkButton" Height="61" HorizontalAlignment="Left" Margin="111,117,0,0" Name="hyperlinkButton1" VerticalAlignment="Top" Width="233" NavigateUri="/Windows1.xaml" >

NavigateUri:只能用Relative的鏈接。

?三.RepeatButton: 可以在按下后,不斷的發出click事件。這樣就可以完成不斷需要變化的需求了,如翻頁、移動等。

<RepeatButton Content="RepeatButton" Height="100" HorizontalAlignment="Left" Margin="76,196,0,0" Name="repeatButton1" VerticalAlignment="Top" Width="315"? Click="repeatButton1_Click"/>

?四.ToggleButton: 觸發按鈕,可以使按鈕有二種(Checked、UnChecked)還是三種狀態(多了一個Indeterminate狀態)。

<ToggleButton? Content="ToggleButton" Height="182" HorizontalAlignment="Left" Margin="104,177,0,0" Name="toggleButton1" VerticalAlignment="Top" Width="268" IsThreeState="True" Checked="toggleButton1_Checked" Unchecked="toggleButton1_Unchecked"? Indeterminate="toggleButton1_Indeterminate"/>

IsThreeState:設置是否有三種狀態

?

?

?

?

?<Button.Content>

??? <Image Source="Chrysanthemum.jpg"/>

?</Button.Content>

?關注技術文章飛秋:http://www.freeeim.com/,24小時專業轉載。

總結

以上是生活随笔為你收集整理的【飞秋】一起学Windows Phone7开发(十三.二 按钮控件)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。