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?
Auto-changing combo-box
Moderators: Dorian (MJT support), JRL
Yes, you can create a ComboBox on a custom dialog and it's contents can be modified with variables.
MJT Net Support
[email protected]
[email protected]
-
- Newbie
- Posts: 10
- Joined: Sun Aug 07, 2005 10:42 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.
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]
[email protected]