WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: edmoran on November 06, 2014, 10:41:13 AM

Title: Multiple dialog boxes??
Post by: edmoran on November 06, 2014, 10:41:13 AM
Can you have a calendar dialog pop up from an existing dialog box and have them both exist at the same time?
Title: Re: Multiple dialog boxes??
Post by: JTaylor on November 06, 2014, 10:51:31 AM
Depends on what you mean exactly.   If you display the dialog directly from the other dialog as part of the same script then you would have to close the Calendar before you could do anything with the original dialog.   If you needed both to be functional at the same time you would need to launch the calendar as a separate script but then you have to deal with the communication between the two scripts if you wanted the date from the calendar.

If you launch the calendar as a part of the original script be sure and use different variable names for the dialogs or you will create problems.

Jim
Title: Re: Multiple dialog boxes??
Post by: edmoran on November 06, 2014, 03:31:24 PM
Here's a bit more information as to what I want to do.  I have a dialog that users need to fill out.  One of the fields is going to be a date field.  I want to help them by popping up a second dialog with a calendar to help them choose the date.  Once they choose the date, the second dialog closes and the value gets transferred to the first dialog for the user to continue.
Title: Re: Multiple dialog boxes??
Post by: JTaylor on November 06, 2014, 04:12:29 PM
Yes.  That will work fine.   Just note the part about using a different dialog variable for the calendar dialog.

Jim
Title: Re: Multiple dialog boxes??
Post by: ....IFICantBYTE on November 06, 2014, 06:26:22 PM
You could also keep it in the same dialog, but have it invisible when you don't want it used, and made visible when you do using DialogControlState(dialog-handle, control-name, request-code, style) with request-code being 3 or 4 and style being 1.
Title: Re: Multiple dialog boxes??
Post by: JTaylor on November 06, 2014, 09:02:13 PM
This is one of the controls where I wish they had used the DateTime Picker Control instead.   So much more useful and flexible.   Something one wouldn't need to hide or pop-up in a separate dialog.   I find the calendar control klunky and hate using it.  Pretty much a last resort kind of option for me.

Jim