Is there a way to limit the number of visible lines on the comboboxgadget, befoe the scroller bar appers?
Regards
Sveinung
Combobox gadget and number of visible limes
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Combobox gadget and number of visible limes
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
BERESHEIT
- electrochrisso
- Addict
- Posts: 989
- Joined: Mon May 14, 2007 2:13 am
- Location: Darling River
Re: Combobox gadget and number of visible limes
Good to know NM, that will come in handy one day. 

PureBasic! Purely the best 

Re: Combobox gadget and number of visible limes
Thank you!netmaestro wrote:CB_SETMINVISIBLE will do the trick.
Sveinung
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Combobox gadget and number of visible limes
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
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

Not a destination
- electrochrisso
- Addict
- Posts: 989
- Joined: Mon May 14, 2007 2:13 am
- Location: Darling River
Re: Combobox gadget and number of visible limes
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.
PureBasic! Purely the best 

- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Combobox gadget and number of visible limes
Me too i have w7...
For me the 3 combo have the same height and the same number of items
For me the 3 combo have the same height and the same number of items


Not a destination
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Combobox gadget and number of visible limes
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.
BERESHEIT
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Combobox gadget and number of visible limes
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 ?
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 ?


Not a destination