首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

有没有能WPF的?

2014-01-14 
有没有会WPF的?????一个普通按钮要求:不要任何边框,不要任何背景鼠标移上去、被点击后、被按下鼠标、松开鼠标

有没有会WPF的?????
一个普通按钮
要求:不要任何边框,不要任何背景
鼠标移上去、被点击后、被按下鼠标、松开鼠标、要这按钮都没任何样式,
只要显示向个字就行!
有知道怎么实现的吗
代码越简单越好


如果谁有Blend 4的视频资源的也可以发来啊   很简单啊

<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="WpfApplication1.MainWindow"
x:Name="Window"
Title="MainWindow"
Width="640" Height="480">
<Window.Resources>
<Style x:Key="ButtonStyle1" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<Rectangle Fill="#FFF4F4F5" RadiusY="10" RadiusX="10" Stroke="Black"/>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="按钮"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True"/>
<Trigger Property="IsDefaulted" Value="True"/>
<Trigger Property="IsMouseOver" Value="True"/>
<Trigger Property="IsPressed" Value="True"/>
<Trigger Property="IsEnabled" Value="False"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>

<Grid x:Name="LayoutRoot">
<Button Content="Button" Margin="222,146,229,200" Style="{DynamicResource ButtonStyle1}"/>
</Grid>
</Window>

[解决办法]
http://v.ku6.com/show/zfax2bbNEw9B7KBg.html
[解决办法]
自定义一个控件呗

热点排行