Auto-changing combo-box

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
cyber_author
Newbie
Posts: 10
Joined: Sun Aug 07, 2005 10:42 am

Auto-changing combo-box

Post by cyber_author » Sun Aug 07, 2005 10:45 am

I am writing a script where a user may save their values as a file. I want to create a dropdown combo-box that will add the name of their file to it's list. furthermore, I want to be able to select that file and load those values into the script.

Can this be done with a combobox?

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sun Aug 07, 2005 2:20 pm

Yes, you can create a ComboBox on a custom dialog and it's contents can be modified with variables.
MJT Net Support
[email protected]

cyber_author
Newbie
Posts: 10
Joined: Sun Aug 07, 2005 10:42 am

Post by cyber_author » Tue Aug 09, 2005 5:42 am

Cool... I figured as much... can you give me an example of how to do it? I am braindead right now and probably could have actually figured it out, but I gave up in frustration. Great program though, I just burned my brain working other items out. :)

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue Aug 09, 2005 10:25 am

Ok, very quick and dirty example with a dialog box with a text field, a button and a combo box. When the button is pressed the value in the text field is added to the list of items in the combo box:

Dialog>Dialog1
Caption=Dialog1
Width=355
Height=170
Top=235
Left=119
Label=List of files:,16,72
Label=New File:,16,24
ComboBox=FileCombo,16,88,145,
Edit=NewFile,16,40,177,
Button=Add,224,32,75,25,10
EndDialog>Dialog1

Show>Dialog1

Label>ActionLoop
GetDialogAction>Dialog1,r
if>r=2,exit
//add button pressed
if>r=10
Let>Dialog1.FileCombo.Items.Text=%Dialog1.FileCombo.Items.Text%%Dialog1.NewFile%
Let>Dialog1.NewFile=
ResetDialogAction>Dialog1
endif
Goto>ActionLoop
Label>exit

Bottom line: Modify DialogName.ComboBoxName.Items.Text to set a combo box's list.
MJT Net Support
[email protected]

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