Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1532 closed Bug (No Bug)

ComboBox custom height not retained after window minimize

Reported by: Spiff59 Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.0 Severity: None
Keywords: Cc:

Description

As shown in the example script below, if a user adjusts the item height of a ComboBox, once the window has been minimized and restored, the ComboBox will revert to it's default item height.

#include <GuiComboBox.au3>
#include <GuiConstants.au3>
Dim $hGUI

$GUI_Main = GuiCreate("", 245, 180, 200, 200)
GUISetFont(7.5, 400, 0)
$Combo1 = GUICtrlCreateCombo("", 20, 36, 200, 16, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1, "1 WEEK|2 WEEKS|4 WEEKS|8 WEEKS|3 MONTHS", "1 WEEK")
_GUICtrlComboBox_SetItemHeight(-1, 12)

$button1 = GUICtrlCreateButton("click to minimize and restore", 20, 80, 200, 18)
$button2 = GUICtrlCreateButton("click to reset combo box height", 20, 120, 200, 18)
GUISetState()
Send("{TAB}")

While 1
    $msg = GUIGetMsg()
    If $msg = $button1 Then
        GUISetState(@SW_MINIMIZE)
        Sleep(100)
        GUISetState(@SW_RESTORE)
		Send("{TAB}{TAB}")
    EndIf
    If $msg = $button2 Then
        _GUICtrlComboBox_SetItemHeight($Combo1, 12)
    EndIf
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Exit

Attachments (0)

Change History (3)

comment:1 Changed 15 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

If you use _GUICtrlComboBox_SetItemHeight() function you must create the control with _GUICtrlComboBox_Create().
The resizing stuff of GUICtrlCreateCombo() is relevant only with GUICtrl...() functions.
Don't mix GUI... Builtins with UDF.
Perhaps one day the situation will change when Valik commit an update of the Builtins functions

comment:2 Changed 15 years ago by Spiff59

In that case, _GUICtrlComboBox_SetItemHeight() has no useful purpose at all, as I can find no way to adjust the font size of a ComboBox created with _GUICtrlComboBox_Create().

If one wishes to have a ComboBox with less height than the default, you either:
A) If created with GUICtrlCreateCombo(), suffer the box reverting to it's default size after a minimize/restore,
-or-
B) If using _GUICtrlComboBox_Create(), you are unable to set the font size small enough to fit in the "skinny" ComboBox.

comment:3 Changed 15 years ago by Jpm

It is certainly possible with _WinAPI...() functions to do the same as AutoIt do for builtin function.
Using UDF in lower detail need a lot of knowledge.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.