AdvancedHMI Software
General Category => Support Questions => Topic started by: Phrog30 on July 25, 2017, 03:28:16 PM
-
I have a clean screen that has a single button that you must hold for "x" time, then the form closes. The form is on top of the main display/parent. If there is a button or some other control directly beneath this button on the clean screen, once the clean screen is closed and mouse released, that control event will fire. Any nice/easy way to prevent this?
James
-
Another option is to use the ScreenCleanButton which will clear itself after the ScreenCleanTimeInterval
-
I don't like the timed screens. A button hold is much better. So, no ideas? :)
-
What about capture time on MouseDown event, then on MouseUp check elapsed time and close if exceeds hold time.
Private MouseDownTime As Date
In MouseDownEvent Handler
MouseDownTime = Now
In MouseUpEvent handler:
Dim LapsedSeconds As Integer = DateAndTime.DateDiff(DateInterval.Second, MouseDownTime, Now)
if LapsedSeconds>3 then
'* Close the form
End if
-
I just added code that required the user to release mouse before exiting. I didn't think I would like how it worked, but it's actually not bad. Thanks for the help.