KeithFrench
Programmer
I am having trouble with a combobox within a dialogbox. Whatever I try I cannot get the combobox to behave as a dropdown box showing the first entry. I cannot get it to show any entries to be precise, which is obviously the problem. My script looks like this:-
proc main
integer Event
string UserNMLst
string UserNM
UserNMLst = "User1, User2, User3, User5, User6"
dialogbox 0 14 20 264 87 3 "Combobox Example"
text 1 2 24 57 9 "Combo list" left
combobox 2 70 21 114 12 DROPDOWN UserNMLst UserNM
pushbutton 3 66 61 48 12 "OK" OK DEFAULT
pushbutton 4 144 63 48 12 "Cancel" CANCEL
enddialog
while 1
dlgevent 0 Event ; Get dialog event.
switch Event ; Evaluate dialog event.
case 0 ; No event occurred.
endcase
case 3 ; OK Button was pressed.
exitwhile ; Exit the while loop.
endcase
Case 4 ; Cancel button was pressed
exit
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Get rid of dialog box.
endproc
Where am I going wrong?
proc main
integer Event
string UserNMLst
string UserNM
UserNMLst = "User1, User2, User3, User5, User6"
dialogbox 0 14 20 264 87 3 "Combobox Example"
text 1 2 24 57 9 "Combo list" left
combobox 2 70 21 114 12 DROPDOWN UserNMLst UserNM
pushbutton 3 66 61 48 12 "OK" OK DEFAULT
pushbutton 4 144 63 48 12 "Cancel" CANCEL
enddialog
while 1
dlgevent 0 Event ; Get dialog event.
switch Event ; Evaluate dialog event.
case 0 ; No event occurred.
endcase
case 3 ; OK Button was pressed.
exitwhile ; Exit the while loop.
endcase
Case 4 ; Cancel button was pressed
exit
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Get rid of dialog box.
endproc
Where am I going wrong?