Function Reference

_GUICtrlComboBox_GetItemHeight

リストアイテム、またはコンボボックスの選択フィールドの高さを調べます。

#Include <GuiComboBox.au3>
_GUICtrlComboBox_GetItemHeight($hWnd, $iIndex = -1)

 

パラメータ

$hWnd コントロールのハンドル
$iIndex どちらの高さを取得するかを決めます:
-1 - 選択フィールドの高さを取得します
 0 - リストアイテムの高さを取得します

 

返し値

成功: ピクセル単位での高さ
失敗: -1

 

注意

なし。

 

関連

_GUICtrlComboBox_SetItemHeight

 


#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GUIComboBox.au3>
#include <GuiConstantsEx.au3>

Opt('MustDeclareVars', 1)

$Debug_CB = False ; ComboBox/ComboBoxEx関数に渡されるClassNameを調べる。動作を確認するにはTrueを設定し、他のコントロールのハンドルを使用

Global $iMemo

_Main()

Func _Main()
    Local $hCombo

    ; GUIを作成
    GUICreate("ComboBox Get Item Height", 400, 296)
    $hCombo = GUICtrlCreateCombo("", 2, 2, 396, 296)
    $iMemo = GUICtrlCreateEdit("", 2, 32, 396, 266, 0)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
    GUISetState()

    ; ファイルを追加
    _GUICtrlComboBox_BeginUpdate($hCombo)
    _GUICtrlComboBox_AddDir($hCombo, @WindowsDir & "\*.exe")
    _GUICtrlComboBox_EndUpdate($hCombo)

    ; アイテムの高さを取得 (選択フィールド)
    MemoWrite("Item Height (selection field): " & _GUICtrlComboBox_GetItemHeight($hCombo))

    ; アイテムの高さを取得 (リストアイテム)
    MemoWrite("Item Height (list items): " & _GUICtrlComboBox_GetItemHeight($hCombo, 0))

    ; アイテムの高さを設定 (選択フィールド)
    _GUICtrlComboBox_SetItemHeight($hCombo, 18)

    ; アイテムの高さを設定 (選択フィールド)
    _GUICtrlComboBox_SetItemHeight($hCombo, 20, 0)

    ; アイテムの高さを取得 (選択フィールド)
    MemoWrite("Item Height (selection field): " & _GUICtrlComboBox_GetItemHeight($hCombo))

    ; アイテムの高さを取得 (リストアイテム)
    MemoWrite("Item Height (list items): " & _GUICtrlComboBox_GetItemHeight($hCombo, 0))

    ; ユーザーが終了するまでループ
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main

; メモコントロールに1行書き込み
Func MemoWrite($sMessage)
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite