10-01-2024 09:56 AM
Hi,
In a Windows and LV-64bits environment, what method do you use to display a dialog box that can be configured in asynchronous mode and with automatic closing after a certain delay?
Thank you in advance for any suggestions, and ideally, an example up to LV version 21.
Best regards
10-01-2024 10:43 AM
I made a floating warning box like this.
I put an event handler in a VI and set the timeout case to whatever delay time that was needed (-1 for no timeout, etc.). The event handler was overkill but I had some other things in mind.
I launched the VI using an asynchronous call and forget. The launcher was wrapped in another VI to hide the details.
I use it to alert the user to non-critical errors that I do not want to interrupt execution of the calling VI. The box pops up for a preset time, then closes automatically if not dismissed by the user.
10-02-2024 09:41 AM
Thank you for these indications.
My preference would be a native Windows “MessageBox” but I haven't found one that offers these features. If anyone knows of a method that comes close, I'm very interested.
10-02-2024 09:45 AM
I basically use a VI that is styled to look just like a Windows Dialog box.
10-02-2024 04:03 PM
@JB wrote:
Thank you for these indications.
My preference would be a native Windows “MessageBox” but I haven't found one that offers these features. If anyone knows of a method that comes close, I'm very interested.
Here is a possible workaround. This assumes that the message box has focus and the button you want pressed has key focus. The attached VI simulates a keyboard press, that is, the user pressing Return to dismiss the dialog. (This works if either the "Ok" or "Cancel" button has key focus. If it doesn't you can simulate a TAB press to move to the correct button.)
It would work as follows:
10-04-2024 01:20 AM
@RTSLVU a écrit :
I basically use a VI that is styled to look just like a Windows Dialog box.
Does it autosize according to the length of the message or do you use an indicator with a vertical scrollbar ?
10-04-2024 09:13 AM - edited 10-04-2024 09:17 AM
@JB wrote:
@RTSLVU a écrit :
I basically use a VI that is styled to look just like a Windows Dialog box.
Does it autosize according to the length of the message or do you use an indicator with a vertical scrollbar ?
TBH: I only use this in one place. In my qualification platform, it pops up when the user presses "Start" and gives the user one minute to select a different test step to start at or 1 (default), pressing "OK" will exit close this pop-up before the time out. That way the end user can restart a test that was aborted somewhere in the middle at the stage it was aborted. Our thermal chambers have a similar pop-up when you start a temperature profile, so I kinda used that as an example.
So to answer your question, the VI is sized to match the message, but it's always the same message.
BTW: It looks big because our test systems have a 19 inch touch screen, so everything I make has to have big buttons the technicians can press with their fat fingers.