Page 1 of 1
Combobox gadget and number of visible limes
Posted: Mon Jun 16, 2014 10:23 pm
by Sveinung
Is there a way to limit the number of visible lines on the comboboxgadget, befoe the scroller bar appers?
Regards
Sveinung
Re: Combobox gadget and number of visible limes
Posted: Mon Jun 16, 2014 11:10 pm
by netmaestro
CB_SETMINVISIBLE will do the trick. Default is 30 items, we test 10 and 50 here:
Code: Select all
OpenWindow(0,0,0,800,600,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ComboBoxGadget(0,20,5,200,20)
For i=0 To 99
AddGadgetItem(0, -1, "Item "+Str(i))
Next
SendMessage_(GadgetID(0), #CB_SETMINVISIBLE,10,0)
ComboBoxGadget(1,250,5,200,20)
For i=0 To 99
AddGadgetItem(1, -1, "Item "+Str(i))
Next
SendMessage_(GadgetID(1), #CB_SETMINVISIBLE,50,0)
Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
Re: Combobox gadget and number of visible limes
Posted: Tue Jun 17, 2014 2:55 am
by electrochrisso
Good to know NM, that will come in handy one day.

Re: Combobox gadget and number of visible limes
Posted: Tue Jun 17, 2014 7:50 am
by Sveinung
netmaestro wrote:CB_SETMINVISIBLE will do the trick.
Thank you!
Sveinung
Re: Combobox gadget and number of visible limes
Posted: Thu Jun 19, 2014 9:44 am
by Kwai chang caine
Hello at all
i'm surprising, me i have exactely the same effect in the three combo
Or perhaps i have not understand something...like usually
Code: Select all
OpenWindow(0,0,0,800,600,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ComboBoxGadget(0,20,5,200,20)
For i=0 To 99
AddGadgetItem(0, -1, "Item "+Str(i))
Next
SendMessage_(GadgetID(0), #CB_SETMINVISIBLE,10,0)
ComboBoxGadget(1,250,5,200,20)
For i=0 To 99
AddGadgetItem(1, -1, "Item "+Str(i))
Next
SendMessage_(GadgetID(1), #CB_SETMINVISIBLE,50,0)
; Default combo
ComboBoxGadget(2,500,5,200,20)
For i=0 To 99
AddGadgetItem(2, -1, "Item "+Str(i))
Next
Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
Re: Combobox gadget and number of visible limes
Posted: Fri Jun 20, 2014 12:59 am
by electrochrisso
I just tried the code you submit and works correct here KCC, what system are you using, I am on win7, I will try win8.1 later and see if that ok.
Re: Combobox gadget and number of visible limes
Posted: Fri Jun 20, 2014 6:01 am
by Kwai chang caine
Me too i have w7...
For me the 3 combo have the same height and the same number of items

Re: Combobox gadget and number of visible limes
Posted: Fri Jun 20, 2014 6:14 am
by netmaestro
The same number of visible items, is that right? All combos have 100 items but the size of the dropdown should be different and show different numbers of items before the scrollbar appears.
Re: Combobox gadget and number of visible limes
Posted: Fri Jun 20, 2014 6:24 am
by Kwai chang caine
Hello Netmaestro,
It's that i don't understand.
I have open each combo one by one (obviously) and the height of each combos open have 23 items if my memory is good (i can't test again i'm on my android tel)
I have even modify your number and no effect
Why kcc never be like the others ?
