Jump to content

ListView resizing


dbkaynor
 Share

Recommended Posts

#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>

$GUI = GUICreate("ListView SIZE example", 400, 300, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX))
$hListView = _GUICtrlListView_Create ($GUI, "", 2, 2, 396, 296, $LVS_REPORT, $WS_EX_CLIENTEDGE )
_GUICtrlListView_SetExtendedListViewStyle ($hListView, $LVS_EX_FULLROWSELECT)
GUISetState()
GUIRegisterMsg($WM_SIZE, "MY_WM_SIZE")

_GUICtrlListView_InsertColumn ($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertColumn ($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn ($hListView, 2, "Column 3", 100)

_GUICtrlListView_AddItem ($hListView, "Row 1: Col 1", 0)
_GUICtrlListView_AddSubItem ($hListView, 0, "Row 1: Col 2", 1)
_GUICtrlListView_AddSubItem ($hListView, 0, "Row 1: Col 3", 2)
_GUICtrlListView_AddItem ($hListView, "Row 2: Col 1", 1)
_GUICtrlListView_AddSubItem ($hListView, 1, "Row 2: Col 2", 1)
_GUICtrlListView_AddItem ($hListView, "Row 3: Col 1", 2)

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func MY_WM_SIZE()
    $size = WinGetClientSize($GUI)
    ControlMove($GUI, '', $hListView, 2, 2, $size[0] - 4, $size[1] - 4)
    Return $GUI_RUNDEFMSG
EndFunc

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...