Jump to content

Height of a ComboBox


HighGuy
 Share

Recommended Posts

The syntax is

GUICtrlCreateCombo ( "text", left, top [, width [, height [, style [, exStyle]]]] )

but the real height of the control seems to be only dependend on what size of font ist used. Is it not possible to create a bigger ComboBox with the given size and center the text vertical?

Here is a test script:

#include <GUIConstants.au3>

GUICreate("My GUI") ; will create a dialog box that when displayed is centered

GUICtrlCreateButton("Button", 10 , 10 , 50, 50)
GUICtrlCreateCombo("", 60 , 10 , 50, 1000)
;_______ very big combo _____________^^^^

GUISetState (@SW_SHOW)    ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Edited by HighGuy
Link to comment
Share on other sites

The syntax is

GUICtrlCreateCombo ( "text", left, top [, width [, height [, style [, exStyle]]]] )

but the real height of the control seems to be only dependend on what size of font ist used. Is it not possible to create a bigger ComboBox with the given size and center the text vertical?

Here is a test script:

#include <GUIConstants.au3>

GUICreate("My GUI"); will create a dialog box that when displayed is centered

GUICtrlCreateButton("Button", 10 , 10 , 50, 50)
GUICtrlCreateCombo("", 60 , 10 , 50, 1000)
;_______ very big combo _____________^^^^

GUISetState (@SW_SHOW)      ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

<{POST_SNAPBACK}>

You experience a Windows XP difference from other window.

Search in the forum I think you will get from Valik the right view.

Windows XP will display the combo as he wants. :lmao:

Link to comment
Share on other sites

I tested a little bit further and found the (my) problem. I assumed that "height" meant the height of the input control with the pull down button, but "height" for combo boxes means height of the complete pull down list! :lmao: If this is the correct behavior it should be added to the documentation because otherwise it is confusing. Of course this doesn't solve my problem: How can I change the height of the combo box imput line (without changing the font size)?

BTW: I'm using my prog on WindowsXP and Windows2000 Terminal Server and get the same height problem. On Windows2000 Terminal Server I encounter another problem: The pull down list is only a small black line of some pixels and no selection is possible. You can only use the up- and down-buttons to choose between the entries o:) .

Link to comment
Share on other sites

Set the height to 80

<{POST_SNAPBACK}>

Thanks. Increasing the height value solved the prob with the Terminal Server, but I'm still asking myself why I should define the complete height of the pull down control? Seems that, to achieve my goal, I have to calculate the font size that suits my wanted height. Stupid :lmao: .
Link to comment
Share on other sites

Thanks. Increasing the height value solved the prob with the Terminal Server, but I'm still asking myself why I should define the complete height of the pull down control? Seems that, to achieve my goal, I have to calculate the font size that suits my wanted height. StupidĀ  :lmao: .

<{POST_SNAPBACK}>

You raise a Valid point I will see what I can do from the code and/or the doc o:)
Link to comment
Share on other sites

  • Administrators

I for one would hate it if everytime I opened a combo it automatically went to full height. I don't see anything wrong with having to specify some pixel height. Maybe add a -1 option for the height that has a good guess.

Link to comment
Share on other sites

Just a suggestion (NOT a request!)

What do you think about a:

GUICtrlCreateCombo ( "text", left, top [, width [, height [,entries [, style [, exStyle]]]]] )

width, height: size of the visible input line of the combo, item vertical centered 
entries: # of list entries shown when opened, with:
  -1: as much as entries in the list
   #: if "# < entries in the list", show scroll bar
      if "# > entries in the list", set "# = entries in the list"

If this is to difficult to realize or if I'm writing nonsense :lmao: then o:) . If so, a better documentation would be fine :)

Link to comment
Share on other sites

Just a suggestion (NOT a request!)

What do you think about a:

GUICtrlCreateCombo ( "text", left, top [, width [, height [,entries [, style [, exStyle]]]]] )

width, height: size of the visible input line of the combo, item vertical centered 
entries: # of list entries shown when opened, with:
  -1: as much as entries in the list
   #: if "# < entries in the list", show scroll bar
      if "# > entries in the list", set "# = entries in the list"

If this is to difficult to realize or if I'm writing nonsense :lmao: thenĀ  o:) . If so, a better documentation would be fine :)

<{POST_SNAPBACK}>

I will try to propose something around this size problem. Stay tune :)
Link to comment
Share on other sites

I am not able to reproduce you behavior under terminal server 2000. It is working as Windows 2000 (I am using the remote administration not the true terminal server) :lmao:

I will document difference between XP/2003 and other Windows version

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...