I would like to make mulible selections from a drop down list. I have always used the list box and I thought that was the difference between list and combo boxes. I checked the help files and the descripiton is about the same. I thought that if you used the Combo box and the user held down the CTRL key multible selections could be made. That does not appear to be the case.
What I am trying to do is read an ini file. If a value is not "0" the item appears in a list that can be selected from. I can do this. However, I want the user to be able to make multible selections from the list. This drop down list would be the preferred method of what I want to accomplish.
Another method that would work would be to use check boxes. However, there are 14 items in the list which means I would have to make 14 different dialog boxes. Dialog box one if one item is greater than 0, dialog box 2 if two items are greater than 0 etc.
Since I don't care about the size the option box I thought that maybe if I assigned a variable to the check box perhaps I could put it in the dialog box.
Such as this
If>option10,writeop1
Let>option1=
Label>writeop1
Let>Option1="CheckBox=msCheckBox2,%Tplate1%,120,40,97,False"
END>writeop1
Dialog>Dialog3
.....
%option1%
EndDialog>Dialog3
This way the dialog box would be built based upon the options. It dosen't work though.
Anyway, any ideas based on not createing 14 dialog boxes?
Multible Selections from one list - list box and Combo Box
Moderators: JRL, Dorian (MJT support)
Yeah this is possible. In your script, you would create the dialog which would have the combo component something like:
Dialog>Blah
ComboBox=comboFood,40,0,153,List not populated
EndDialog>Blah
Then you can...
Show>Blah
then have your routine that reads the values, and set them, so %myValues% would become something like: Eggs%CRLF%Bacon
And update the dialog combo component with
Let>Blah.comboFood=%myValues%
ResetDialogAction>Blah
It seems that this doesn't currently work, although the documentation says it should (and using an "Edit" component instead of a combo does work).
Marcus - another one for the to-fix list?
Dialog>Blah
ComboBox=comboFood,40,0,153,List not populated
EndDialog>Blah
Then you can...
Show>Blah
then have your routine that reads the values, and set them, so %myValues% would become something like: Eggs%CRLF%Bacon
And update the dialog combo component with
Let>Blah.comboFood=%myValues%
ResetDialogAction>Blah
It seems that this doesn't currently work, although the documentation says it should (and using an "Edit" component instead of a combo does work).
Marcus - another one for the to-fix list?
It least it wasn't me
Thanks, I thought I was doing something wrong as I couldn't figure out the differences between the Combo and List box.
No that sets the selected item index of the combo and is used in non modal dialogs.
You can easily change the list in modal dialogs:
Let>list=1%CRLF%2
Dialog>Dialog1
Caption=Non-Modal Dialog
Top=113
Width=264
Left=16
Height=113
Button=Update,16,8,75,25,5
Button=Exit,16,48,75,25,6
Edit=msEdit1,104,8,121,Fred
ComboBox=msComboBox1,104,32,121,%list%
Edit=msEdit2,104,56,121,
EndDialog>Dialog1
Show>Dialog1,r
Wait>2
Let>list=3%CRLF%4
Show>Dialog1,r
Rather crude example which 2 seconds after you have closed the dialog the first time it changes the list and displays it again with the new list. Obviously you are more likely to make the change within a loop which checks the outcome of other fields on the dialog.
You can easily change the list in modal dialogs:
Let>list=1%CRLF%2
Dialog>Dialog1
Caption=Non-Modal Dialog
Top=113
Width=264
Left=16
Height=113
Button=Update,16,8,75,25,5
Button=Exit,16,48,75,25,6
Edit=msEdit1,104,8,121,Fred
ComboBox=msComboBox1,104,32,121,%list%
Edit=msEdit2,104,56,121,
EndDialog>Dialog1
Show>Dialog1,r
Wait>2
Let>list=3%CRLF%4
Show>Dialog1,r
Rather crude example which 2 seconds after you have closed the dialog the first time it changes the list and displays it again with the new list. Obviously you are more likely to make the change within a loop which checks the outcome of other fields on the dialog.
MJT Net Support
[email protected]
[email protected]
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact: