Combobox gadget and number of visible limes

Windows specific forum
User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Combobox gadget and number of visible limes

Post by Sveinung »

Is there a way to limit the number of visible lines on the comboboxgadget, befoe the scroller bar appers?

Regards
Sveinung
User avatar
netmaestro
PureBasic Bullfrog
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

Post 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
BERESHEIT
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: Combobox gadget and number of visible limes

Post by electrochrisso »

Good to know NM, that will come in handy one day. :)
PureBasic! Purely the best 8)
User avatar
Sveinung
Enthusiast
Enthusiast
Posts: 142
Joined: Tue Oct 07, 2003 11:03 am
Location: Bergen, Norway

Re: Combobox gadget and number of visible limes

Post by Sveinung »

netmaestro wrote:CB_SETMINVISIBLE will do the trick.
Thank you!

Sveinung
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Combobox gadget and number of visible limes

Post by Kwai chang caine »

Hello at all

i'm surprising, me i have exactely the same effect in the three combo :shock:
Or perhaps i have not understand something...like usually :oops:

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
ImageThe happiness is a road...
Not a destination
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: Combobox gadget and number of visible limes

Post 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.
PureBasic! Purely the best 8)
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Combobox gadget and number of visible limes

Post by Kwai chang caine »

Me too i have w7...
For me the 3 combo have the same height and the same number of items :shock:
ImageThe happiness is a road...
Not a destination
User avatar
netmaestro
PureBasic Bullfrog
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

Post 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.
BERESHEIT
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Combobox gadget and number of visible limes

Post 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 :shock:
Why kcc never be like the others ? :(
ImageThe happiness is a road...
Not a destination
Post Reply