Combo Box Help box

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Combo Box Help box

Post by Bob Hansen » Wed Mar 26, 2003 7:18 pm

It would be nice to have a label box that changes value based on the selection showing in the combo box. This would provide help for the user.

I have had to provide a multipurpose label (CombpHelp) for now but only works because I have just 3 choices. This would not be practical for multiple choices.

I have included a basic script here for Exiting Windows that allows me to run certain maintenance steps (such as logging users) before closing down.

(Note that I had to check for blank value in combo box).
=======================================
//Define macro variables
Let>RP_WAIT=1
Let>ComboHelp=Log Off allows Log on as a new user.%CRLF%Shut Down turns off power.%CRLF%Re Boot restarts computer

Dialog>WindowsExit
Caption=Shut Down Windows
Top=144
Width=325
Left=312
Height=193
Label=What do you want the computer to do?,54,16
Label=%ComboHelp%,32,72
Button=OK,21,128,75,25,1
Button=Cancel,117,128,75,25,2
Button=Help,205,128,75,25,3
ComboBox=msComboBox1,80,40,145,Log Off%CRLF%Re Boot%CRLF%Shut Down
EndDialog>WindowsExit

//Prompt User to select method of Shutdown
Label>ShowWindow
Show>WindowsExit,Button
Goto>%Button%

//Help Button
Label>3
//Provide modal instructions
MessageModal>This is a HELP window to explain how this works
Goto>ShowWindow

//Cancel Button
Label>2
Goto>End

//OK Button
Label>1
If>%WindowsExit.msCombobox1%=,ShowWindow
Goto>%WindowsExit.msCombobox1%

Label>Shut Down
Let>Choice=0
//Insert actions to run on Shut Down
Run Program>C:\batch\ShutDown.bat
Goto>End

Label>Re Boot
Let>Choice=1
//Insert actions to run on Re Boot
Run Program>C:\batch\ReBoot.bat
Goto>End

Label>Log Off
Let>Choice=2
//Insert actions to run on Log Off
Run Program>C:\batch\LogOff.bat
Goto>End

Label>End
//Messages here are for test purposes only
MessageModal> You have decided to %WindowsExit.msCombobox1%%CRLF%and Windows will close using Option %Choice%
//ShutDownWindows>%Choice%
Message>All Done

================================
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts