I try to set the button so that only when the mouse goes over it the button changes its visual properties to the activated button.
This is my code:
<Button Foreground="Black" Content="OK" Margin="186,100,170,172" > <Button.Style> <Style TargetType="Button"> <Setter Property="IsEnabled" Value="False" /> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="IsEnabled" Value="True" /> </Trigger> </Style.Triggers> </Style> </Button.Style> </Button>
Thanks in advance for your help.
You can encapsulate your button on the border to get what you need.
<Border Name="buttonBorder" Margin="186,100,170,172" Background="#01000000" BorderBrush="Transparent" BorderThickness="0"> <Button Foreground="Black" Content="OK"> <Button.Style> <Style TargetType="Button"> <Setter Property="IsEnabled" Value="False" /> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=buttonBorder, Path=IsMouseOver}" Value="True"> <Setter Property="IsEnabled" Value="True" /> </DataTrigger> </Style.Triggers> </Style> </Button.Style> </Button> </Border>
I don’t think it’s possible what you want to do here, because when the button is disabled, IsMouseOver is false (also it does not generate MouseMove or other events).
, (, , , ? ... , ? , ), , , , - ).
Source: https://habr.com/ru/post/1780894/More articles:Ужасная производительность Silverlight - ListBox - silverlightКак получить расширение файла для типа Mime (тип содержимого) - javaWhich rails are best produced? - ruby | fooobar.comhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1780892/r-assigning-posixct-class-to-a-data-frame&usg=ALkJrhhbB8wceMiKPNEZf7tOavJzhjzN7QHow to use named column in excel formulas - excelPython Octave Equivalent Optparse / getopt - octavePHP: Should I worry about MySQL extension or just learn PDO? - phpSQLConnection with a Using statement, calling SQLDataReader from the inside? - sqlPHP - a function that returns material that echoes other functions - functionVague behavior when starting a new activity using PendingIntent - androidAll Articles