Opened on Mar 22, 2010 at 1:36:41 PM
Closed on Mar 22, 2010 at 3:02:29 PM
Last modified on Mar 24, 2010 at 6:46:24 AM
#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 by , on Mar 22, 2010 at 3:02:29 PM
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
comment:2 by , on Mar 23, 2010 at 1:25:26 PM
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 by , on Mar 24, 2010 at 6:46:24 AM
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.

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