Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Aspect Combobox Does'nt Show Lists

Status
Not open for further replies.

KeithFrench

Programmer
Jul 20, 2001
25
0
0
GB
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?


 
morning, I see a couple problems with your script. The first one is that your list is there its just that the "height" of your combo box is too small and the list can't be displayed. If you take your current script and click inside the combobox, then use your up and down arrow keys you will see your list. Modify the current height of the combobox from 12 to as large as you need to display your list.
The second thing, if you want an item on the list to default as a "preselected" value, set the variable userNM to the value you want displayed prior to creating the dialog box and that item will show in the combo box when the box is created.
 
Keith, you need to make the combobox control a little "taller" so that the entries display. If you look closely when the script is run, you can see just a little bit of the drop-down appearing and you can scroll down the list with the arrow keys and see your values. I copied the dialog code, pasted it into the Dialog Editor, monkeyed with it a bit and got it to display two lines at a time from the combobox. Here is the modified code:

dialogbox 0 14 20 264 87 3 "Combobox Example"
text 1 2 24 57 9 "Combo list" left
combobox 2 70 21 114 34 DROPDOWN UserNMLst UserNM
pushbutton 3 66 61 48 12 "OK" OK DEFAULT
pushbutton 4 144 63 48 12 "Cancel" CANCEL
enddialog

If you want to increase the height further, you will need to move the OK and Cancel buttons lower in the dialog (and possibly resize the dialog taller as well).
aspect@aspectscripting.com
 
Thanks to you both for your help, its all sorted now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top