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

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

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

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

復(fù)制代碼
代碼如下:

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

標(biāo)簽:山南 懷化 青島 荊門 延邊 哈密 潮州 昭通

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《XAML中Button重繪為圓形的方法技巧》,本文關(guān)鍵詞  XAML,中,Button,重繪,為,圓,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《XAML中Button重繪為圓形的方法技巧》相關(guān)的同類信息!
  • 本頁收集關(guān)于XAML中Button重繪為圓形的方法技巧的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 周至县| 洛扎县| 密云县| 襄樊市| 都昌县| 鄄城县| 龙州县| 河东区| 息烽县| 枣强县| 台南县| 张掖市| 酉阳| 阿克苏市| 大田县| 合阳县| 枣强县| 垫江县| 东兰县| 福清市| 房山区| 广饶县| 长葛市| 三门县| 那曲县| 大理市| 大余县| 武安市| 肃宁县| 景洪市| 都匀市| 林口县| 镇坪县| 遂溪县| 章丘市| 夏津县| 乳源| 玉环县| 柳州市| 虎林市| 大名县|