ComboBox height?
BlitzPlus Forums/BlitzPlus Programming/ComboBox height?
| ||
The comboboxes always stop at about 200 pixels, and create a slider on the side to scroll down the list. This is inconvenient when you have a long list of items (like a directory of textures). Is there any way to extend the vertical size of the drop-down box? |
| ||
I, too, would like to know... |
| ||
And so would I... |
| ||
I never found a way to extend it. |
| ||
Thats pretty lame. In Delphi I made a combobox that checked the size of the form (parent) it was on and sized the dropdown to either use the max amount avaiable on the form or show all of the items if they fitted. |
| ||
Maybe you could stick it inside a pane and lock the top to the top of the pane and the bottom to the bottom of it? |
| ||
I use this in blitzmax so i dont know if this will work for blitzplus but give it a go.Const CB_SETITEMHEIGHT=339 Function ComboBoxHeight( gadget, height ) SendMessage_(gadget,CB_SETITEMHEIGHT,-1,height) End Function |
| ||
CB_SETITEMHEIGHT sets the height of the combobox window, but has no effect on the dropdown list. CB_SETMINVISIBLE seems to be the right message, but it always fails when I try it: Const CB_SETMINVISIBLE=$1701 window=CreateWindow( "ComboBox demo",0,0,160,120+80 ) combobox=CreateComboBox( ClientWidth(window)/2-64,ClientHeight(window)/2-12,128,500,window ) For k=0 To 50 AddGadgetItem combobox,"Item "+k Next SelectGadgetItem combobox,0 hwnd=QueryObject(combobox,1) result=SendMessage(hwnd,CB_SETMINVISIBLE,40,0) If Not result Notify "SendMessage() failed." While WaitEvent()<>$803 If EventID()=$401 If EventSource()=combobox Notify "Item selected:"+SelectedGadgetItem(combobox) EndIf EndIf Wend End See the MS docs: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/comboboxes/comboboxes.asp |