日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

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

發布時間:2025/3/15 windows 19 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【飞秋】一起学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开发(十三.二 按钮控件)的全部內容,希望文章能夠幫你解決所遇到的問題。

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