婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > XAML中Button重繪為圓形的方法技巧

XAML中Button重繪為圓形的方法技巧

熱門標簽:AI外呼系統(tǒng) 價格 錦州企業(yè)外呼系統(tǒng) 最簡單的百度地圖標注店鋪 梧州地圖標注app 禹州電話外呼系統(tǒng) 青海保險智能外呼系統(tǒng)商家 營口400電話申請 新鄉(xiāng)機器人外呼系統(tǒng) 水經(jīng)注萬能地圖標注
在用XAML布局的時候,有時候為了使界面Metro化,有些Button要使用圓形代替默認的長方形。以下的Button樣式可以解決這個問題,可以根據(jù)自己的需要再加以修改。當然如果你熟悉Bland的話可以直接使用它來繪制你需要的樣式,但是貼代碼是否更快一點呢?

復制代碼
代碼如下:

<Style x:Key="btnNext" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="rectangle">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Thickness>-3</Thickness>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Normal"/>
<VisualState x:Name="Disabled"/>
<VisualState x:Name="MouseOver"/>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="rectangle" RadiusY="25" RadiusX="25" Stroke="Blue" StrokeThickness="4">
</Rectangle>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Margin" Value="5"/>
<Setter Property="Width" Value="50"/>
<Setter Property="Height" Value="50"/>
<Setter Property="FontSize" Value="120"/>
<Setter Property="Foreground" Value="White"/>
</Style>

標簽:山南 懷化 青島 荊門 延邊 哈密 潮州 昭通

巨人網(wǎng)絡通訊聲明:本文標題《XAML中Button重繪為圓形的方法技巧》,本文關(guān)鍵詞  XAML,中,Button,重繪,為,圓,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡,涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《XAML中Button重繪為圓形的方法技巧》相關(guān)的同類信息!
  • 本頁收集關(guān)于XAML中Button重繪為圓形的方法技巧的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 凤台县| 麟游县| 云和县| 崇义县| 水城县| 宿迁市| 厦门市| 新兴县| 商丘市| 宁都县| 丹巴县| 贵州省| 来安县| 玉林市| 定结县| 磐安县| 阿克苏市| 青田县| 龙江县| 黎平县| 田阳县| 陇南市| 武强县| 微山县| 潮安县| 积石山| 汝城县| 遂川县| 佳木斯市| 全州县| 阿拉善右旗| 大埔区| 德江县| 化德县| 皋兰县| 祁阳县| 漯河市| 芜湖市| 康马县| 仙桃市| 商河县|