04-30-2014 02:10 PM
Hi Everyone,
I have made a WPF application with boolean leds, I want to control their state on two events only, MouseEnter and Mouse Leave, my problem is, that the mouse click is still enabled and is changing the state of the control.
Being a DaqMx application it is firing an output of a NI IO board
I would like to know if there is a way of controlling the boolean only with these events MouseEnter and MouseLeave, or at least removing the changing state(color) of the control when this one is pressed.
I tried to set the ClickMode property to hover but in this case it stops firing the MouseEnter and MouseLeave events.
Thanks,
Best Regards,
04-30-2014 03:18 PM
OK,
I found a simple solution but maybe not the best if later I want to use the state_change event on these controls.
just adding that in the event
Private Sub P02P05_Click(sender As Object, e As RoutedEventArgs) Handles P02P05.Click
P02P05.Value = Not P02P05.Value
End Sub
If someone has another better solution I'll be greatful.
Best Regards.
05-01-2014 09:50 AM
From your description, it sounds like you want the Value
of an LED
to toggle when the mouse enters and leaves the control. You can achieve this by setting the ClickMode
property to Hover
and IsMomentary
to true
:
<ni:LED IsReadOnly="False" ClickMode="Hover" IsMomentary="True" />
05-04-2014 02:35 AM
Hi Paul,
Thanks for your answer, I haven't got time to check that out yet, but I will shortly and keep you posted if it work.
Best Regards,