Jump to content

No vertical scrolls in combobox


Recommended Posts

Hi,

I'm trying to create a combo box where the users are not able to edit their selection. I'm using the $CBS_DROPDOWNLIST style for that.

The only problem is that I dont have the scrolling arrows and I have more values stored in the combo box than they actually appear. If I click and hold down the left mouse button it will scroll down but I cannot see the scrolling arrows...

How can I fix that?

Thanks,

$type_blockorder_create_select = GUICtrlCreateCombo("", 305, 149, 145, 25, $CBS_DROPDOWNLIST)

Link to comment
Share on other sites

Hi,

I'm trying to create a combo box where the users are not able to edit their selection. I'm using the $CBS_DROPDOWNLIST style for that.

The only problem is that I dont have the scrolling arrows and I have more values stored in the combo box than they actually appear. If I click and hold down the left mouse button it will scroll down but I cannot see the scrolling arrows...

How can I fix that?

Thanks,

$type_blockorder_create_select = GUICtrlCreateCombo("", 305, 149, 145, 25, $CBS_DROPDOWNLIST)

Set the height to 120 or above

$type_blockorder_create_select = GUICtrlCreateCombo("", 305, 149, 145, 125, $CBS_DROPDOWNLIST)

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

I did that... I still dont see the vertical scrolls.

Thanks,

I don't either.

I've never been able to produce a vertical scroll bar for a combobox. Mine always show the whole list.

Can you show the code you have which produces the incomplete list?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I don't either.

I've never been able to produce a vertical scroll bar for a combobox. Mine always show the whole list.

Can you show the code you have which produces the incomplete list?

THe truth is I dont do anything special. Thats just how it shows up by default. Would you know how I can make the combo box's edit control readonly without disabling the combobox itself?

Link to comment
Share on other sites

THe truth is I dont do anything special. Thats just how it shows up by default. Would you know how I can make the combo box's edit control readonly without disabling the combobox itself?

The $CBS_DROPDOWNLIST style does that.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

The $CBS_DROPDOWNLIST style does that.

What I meant is if you initialize it by default without using a style, you can edit the combo box's edit control and you also have the vertical scroll (well in my case thats how it is)

So by using the default initialization, without any styles, I wanna make the text control of the combo box read-only.

Do you know how?

$var = GUICtrlCreateCombo("", 305, 149, 145, 125)

Link to comment
Share on other sites

What I meant is if you initialize it by default without using a style, you can edit the combo box's edit control and you also have the vertical scroll (well in my case thats how it is)

So by using the default initialization, without any styles, I wanna make the text control of the combo box read-only.

Do you know how?

$var = GUICtrlCreateCombo("", 305, 149, 145, 125)

Do you mean you want the user to be able to click into the edit box without the list dropping drown, but you don't want them to be able to edit the text? If this is what you mean then I can't suggest a way, but I don't see why you would want this.

If you mean that you want to be able to set the combobox to the drop down style programmatically then you can use GuiCtrlSetStyle($var,$CBS_DROPDOWN)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Add this option $WS_VSCROLL when you create the combo so it will look like:

BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL)

if you want it sorted you can add $CBS_SORT

EDIT: setting the height is an useful option in Win2k - WinXP works without it.

Edited by enaiman

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

Add this option $WS_VSCROLL when you create the combo so it will look like:

if you want it sorted you can add $CBS_SORT

EDIT: setting the height is an useful option in Win2k - WinXP works without it.

I have XP SP on one PC, XP Professional SP2 on another. Adding $WS_VSCROLL has no effect for me. The comboboxes have always dropped down with the complete list regardless of the number of items and regardless of the height setting. I assume I am doing something wrong but if anyone can tell me I would be grateful.

This is an example of a list which has no vertical scroll bars for me on either PC.

$Combo1 = GUICtrlCreateCombo("Combo1", 280, 88, 145, 135, BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL))

GUICtrlSetData(-1, "g|g|dgd|gdg|dg|dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgr drg dgnh|jm df |f g| asef |aef d|g sadf earg ")

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I have XP SP on one PC, XP Professional SP2 on another...

...This is an example of a list which has no vertical scroll bars for me on either PC.

$Combo1 = GUICtrlCreateCombo("Combo1", 280, 88, 145, 135, BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL))

GUICtrlSetData(-1, "g|g|dgd|gdg|dg|dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgr drg dgnh|jm df |f g| asef |aef d|g sadf earg ")

Same results on my pc until I added a ton more content to the combobox entries. Perhaps I'm missing something regarding screen resolution or some such, but by adding a lot more selection items with your above code DID finally yield a vert scroll when I tested.

$Combo1 = GUICtrlCreateCombo("", 280, 88, 145, 20, BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL))
GUICtrlSetData($Combo1, "g|g|dgd|gdg|dg|dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgr drg dgnh|jm df |f g| asef |aef d|g sadf earg ")

-Mo

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Link to comment
Share on other sites

Same results on my pc until I added a ton more content to the combobox entries. Perhaps I'm missing something regarding screen resolution or some such, but by adding a lot more selection items with your above code DID finally yield a vert scroll when I tested.

$Combo1 = GUICtrlCreateCombo("", 280, 88, 145, 20, BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL))
GUICtrlSetData($Combo1, "g|g|dgd|gdg|dg|dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgdgagrf drg dgr |adg |dgr |drg d|gr adrg |dgr drg dgnh|jm df |f g| asef |aef d|g sadf earg ")

-Mo

thanks a million. that works!

Link to comment
Share on other sites

No prob... Odd little detail, that, but at least now I'll know if I ever run across it in my own stuff :whistle:

- Mo

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Link to comment
Share on other sites

No prob... Odd little detail, that, but at least now I'll know if I ever run across it in my own stuff :whistle:

- Mo

Very interesting!

The critical number on 2 PCs I've tried is 30 items, (different versions of XP and different screen resolutions); 31 and the vertical scrollbar appears.

But you should be able to set the drop down count to a smaller number.

If I use a combobox in Delphi for example I can set the drop down count to 5 or any number I want and it works fine. According to some examples of VB I've seen the dropdown list is determined by the height setting using the API move function which I would have guessed is the same as GuiCtrlSetPos, but this has no effect for me.

But why do some people say they have the scrolbars for much smaller lists? Are they using Vista?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I have found how to change the number of visible drop down items in a combobox and get the vertical scrollbar. Probably I am not the first person to find this!

You must create the combobox with the style shown below, and make sure the height is a low value like 20

$Combo1 = GUICtrlCreateCombo("Combo example", 280, 88, 95, 20, BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL))

then set the maxumum drop down count with (assuming you have more than $number items)

GUICtrlSendMsg($combo1,$CB_SETMINVISIBLE,$number,0);it actually sets the Max Visible!

The actaul number of items shown might be changed to a value more than $number depending on the value used for height.

With a height of 20 set on creation $CB_SETMINVISIBLE can set the number as low as 1. If the height is set at 120 then the minimum is 5 items.

Once the $CB_SETMINVISIBLE message has been sent then the number of the drop down items can also be changed by setting the Combobox height with GuiCtrlSetPos, but GuiCtrlSendMsg is easier.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

You must create the combobox with the style shown below, and make sure the height is a low value like 20

$Combo1 = GUICtrlCreateCombo("Combo example", 280, 88, 95, 20, BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL))

then set the maxumum drop down count with (assuming you have more than $number items)

GUICtrlSendMsg($combo1,$CB_SETMINVISIBLE,$number,0);it actually sets the Max Visible!

Good find, martin - bookmarking this one! :whistle:

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...