您只需删除onclick,并更改颜色,并使之成为您的“禁用”状态。
命名空间: Microsoft.TeamFoundation.Controls.WPF 程序集: Microsoft.TeamFoundation.Controls(在 Microsoft.TeamFoundation.Controls.dll 中)语法C# 复制 public Color ButtonDisabledForegroundColor { get; } 属性值类型:System.Windows.Media.Color 返回Color。
How to change the foreground color of a disabled button in WPF How to change the language in my View (WPF) How to change the orientation of menuitems in a menu from vertical to horizontal? How to change the Path data source dynamically based on some condition How to change the Theme of...
要删除默认MouseOver行为,Button您需要修改ControlTemplate。将您的Style定义更改为以下内容应该可以解决问题...
"Button"><BorderTextBlock.Foreground="{TemplateBinding Foreground}"x:Name="Border"CornerRadius="2"BorderThickness="1"><Border.BorderBrush><LinearGradientBrushStartPoint="0,0"EndPoint="0,1"><LinearGradientBrush.GradientStops><GradientStopCollection><GradientStopColor="{DynamicResource BorderLightColor}"...
<Button Width="100" Height="40"/> </StackPanel> </Grid> 使用WrapPanel可以进行自动换行。 WrapPanel:水平或垂直排列元素,针对剩余空间不足会进行换行或换列 Title="MainWindow" Height="450" Width="200"> <Grid> <WrapPanel Orientation="Horizontal"> ...
F6"/><SolidColorBrushx:Key="Button.Pressed.Border"Color="#FF2C628B"/><SolidColorBrushx:Key="Button.Disabled.Background"Color="#FFF4F4F4"/><SolidColorBrushx:Key="Button.Disabled.Border"Color="#FFADB2B5"/><SolidColorBrushx:Key="Button.Disabled.Foreground"Color="#FF838383"/><Stylex:Key...
--鼠标在关闭按钮上方时背景颜色--> <LinearGradientBrush x:Key="CloseCaptionButtonBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FF9B9D" Offset="0.123456" /> <GradientStop Color="#FF464B" Offset="0.987654"/> </LinearGradientBrush> <!--关闭按钮按下背景刷-->...
{RelativeSource TemplatedParent}}" > <Path.Fill> <SolidColorBrush Color="{DynamicResource GlyphColor}"/> </Path.Fill> </Path> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}"> <Setter Property="...
Can I override the disabled background color for a listbox? Can I show a web-page inside WPF? can I switch a canvas from pixels to millimeters? Can I use JavaScript In WPF Can MultiBinding be used with a TextBox? Can only call DragMove when primary mouse button is down. Can Text...