Retrieves the width of a column in report or list view
#include <GuiListView.au3>
_GUICtrlListView_GetColumnWidth ( $hWnd, $iCol )
$hWnd | Control ID/Handle to the control |
$iCol | The index of the column. This parameter is ignored in list view. |
Success: | the column width. |
Failure: | 0. |
If this message is sent to a list-view control with the $LVS_REPORT style and the specified column doesn't exist, the return value is undefined.
_GUICtrlListView_SetColumnWidth
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>
Example()
Func Example()
Local $idListview
GUICreate("ListView Get Column Width", 400, 300)
$idListview = GUICtrlCreateListView("Column 1|Column 2|Column 3", 2, 2, 394, 268)
GUISetState(@SW_SHOW)
_GUICtrlListView_SetColumnWidth($idListview, 0, 100)
; Change column 1 width
MsgBox($MB_SYSTEMMODAL, "Information", "Column 1 Width: " & _GUICtrlListView_GetColumnWidth($idListview, 0))
_GUICtrlListView_SetColumnWidth($idListview, 0, 150)
MsgBox($MB_SYSTEMMODAL, "Information", "Column 1 Width: " & _GUICtrlListView_GetColumnWidth($idListview, 0))
; Loop until the user exits.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example