日期:2014-05-17  浏览次数:20774 次

有没有会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
------解决方案--------------------
自定义一个控件呗