I am working on an app that is compiled as an .exe file. I would like the app to display a dialog with, say, 3 buttons and a Close button. Pressing any one of the 3 buttons performs a related task, such as setting focus on a Window and entering some test.
After the user presses one of the 3 buttons, is it possible to minimize the dialog (or at least leave it up behind the current window) so that the user can return to it later to press another button to perform another task? When the user is done using the app, pressing the Close button closes it.
Minimize and reuse a dialog
Moderators: JRL, Dorian (MJT support)
Minimize and reuse a dialog
Wells H. Anderson
Active Practice LLC
Active Practice LLC
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Yes. You could even hide it. But I'm not sure that you even need to do that. Even if you close it, it is still available to use again - you just need to Show it again when the user needs it.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
How do you hide a Dialog? Would I use:
SetDialogProperty>Dialog1,frmDesign_1,Visible,False ?
I assume I would need to use that code in the actions for each of my 3 buttons. But then I am not sure how the user could get back to the dialog. If I make the dialog visible again when a button's actions finish, wouldn't the dialog get the focus? I am hoping to leave the dialog behind the current window and accessible by clicking its icon on the Windows taskbar.
Also, if the user closes a Dialog, I understand that it is still available to be displayed with Show>Dialog1, but how do I keep the app from simply running to the end of the code and terminating when the user closes the Dialog? I want the app to terminate when the user clicks the Close button or the red X close control in the upper right corner.
Thank you for the very fast response to my first post!
SetDialogProperty>Dialog1,frmDesign_1,Visible,False ?
I assume I would need to use that code in the actions for each of my 3 buttons. But then I am not sure how the user could get back to the dialog. If I make the dialog visible again when a button's actions finish, wouldn't the dialog get the focus? I am hoping to leave the dialog behind the current window and accessible by clicking its icon on the Windows taskbar.
Also, if the user closes a Dialog, I understand that it is still available to be displayed with Show>Dialog1, but how do I keep the app from simply running to the end of the code and terminating when the user closes the Dialog? I want the app to terminate when the user clicks the Close button or the red X close control in the upper right corner.
Thank you for the very fast response to my first post!
Wells H. Anderson
Active Practice LLC
Active Practice LLC
Like so...
Code: Select all
//Hide the dialog
SetDialogProperty>Dialog1,,Visible,False
//Show the dialog
SetDialogProperty>Dialog1,,Visible,True
-
- Macro Veteran
- Posts: 267
- Joined: Mon Sep 27, 2010 8:57 pm
- Location: Seattle, WA
Visible Property not returning correctly
I have had issuses when hiding dialogs and I still am. The issue is that when the Dialog returns it is not in the same position. First off the issue could be related to double monitors, I am not sure.
I have the Dialog set to open on the desktop centered, however with double monitors you need to drag it to one or the other. The user of this will not necessarly have double monitors. So it is acceptable to have it this way.
What happens is once I set the visible property to false it correctly hides it. When I set it back to true, only a portion of it reapears and I have to drag it back to where it was.
I believe it is not really being hidden, just moved off the desktop; however when it returns it needs to go to the last position.
Anyway, that is what is happening to me, is anyone else having this issue?
I have the Dialog set to open on the desktop centered, however with double monitors you need to drag it to one or the other. The user of this will not necessarly have double monitors. So it is acceptable to have it this way.
What happens is once I set the visible property to false it correctly hides it. When I set it back to true, only a portion of it reapears and I have to drag it back to where it was.
I believe it is not really being hidden, just moved off the desktop; however when it returns it needs to go to the last position.
Anyway, that is what is happening to me, is anyone else having this issue?
If I run this script I get a blinking dialog that maintains its position. Every time I start teh script the dialog shows up in a new place. But while the script is running the dialog does not move.
Code: Select all
Dialog>Dialog1
EndDialog>Dialog1
Show>Dialog1
Wait>1
SetDialogProperty>Dialog1,,Visible,False
Wait>1
SetDialogProperty>Dialog1,,Visible,True
Wait>1
SetDialogProperty>Dialog1,,Visible,False
Wait>1
SetDialogProperty>Dialog1,,Visible,True
Wait>1
SetDialogProperty>Dialog1,,Visible,False
Wait>1
SetDialogProperty>Dialog1,,Visible,True
Wait>1
SetDialogProperty>Dialog1,,Visible,False
Wait>1
SetDialogProperty>Dialog1,,Visible,True
Wait>1
Moves for me
For me when it becomes visible only about 25% of it can be seen. I am using the exact same commands (naturally there is different code inbetween them). All I can think of is it has to do with the dialog that comes up when the fist one is hidden.
I just tested your sample and it worked correctly on my machine so it is not the dual monitors.
I just tested your sample and it worked correctly on my machine so it is not the dual monitors.