Function Reference

_GUICtrlListBox_SetHorizontalExtent

リストボックスで水平にスクロールできる幅をピクセル単位で設定します。

#Include <GuiListBox.au3>
_GUICtrlListBox_SetHorizontalExtent($hWnd, $iWidth)

 

パラメータ

$hWnd コントロールのハンドル
$iWidth リストボックスをスクロールできるピクセル数を指定します

 

返し値

なし。

 

注意

Microsoft Windows 95/Windows 98/Windowsミレニアムエディション(Windows Me) : $iWidthパラメータは16ビット値に制限されています。

_GUICtrlListBox_SetHorizontalExtentを使用するにはリストボックスに$WS_HSCROLLスタイルが定義されている必要があります。

 

関連

_GUICtrlListBox_GetHorizontalExtent

 


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

Opt('MustDeclareVars', 1)

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

_Main()

Func _Main()
    Local $hListBox

    ; GUIを作成
    GUICreate("List Box Set Horizontal Extent", 400, 296)
    $hListBox = GUICtrlCreateList("", 2, 2, 396, 296, BitOR($WS_BORDER, $WS_VSCROLL, $LBS_NOTIFY, $LBS_DISABLENOSCROLL, $WS_HSCROLL))
    GUISetState()

    ; 長い文字列を追加
    _GUICtrlListBox_AddString($hListBox, "AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI.")

    ; 現在の水平方向範囲を表示
    MsgBox(4160, "Information", "Horizontal Extent: " & _GUICtrlListBox_GetHorizontalExtent($hListBox))

    _GUICtrlListBox_SetHorizontalExtent($hListBox, 500)

    ; 現在の水平方向範囲を表示
    MsgBox(4160, "Information", "Horizontal Extent: " & _GUICtrlListBox_GetHorizontalExtent($hListBox))

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