Achilles Posted August 14, 2008 Posted August 14, 2008 This is what I've tried... I want the subitems to be centered but the header to be left aligned: #include <GuiConstantsEx.au3> #include <GuiListView.au3> GUICreate("ListView Set Column", 400, 300) $hListView = GUICtrlCreateListView("", 2, 2, 394, 268) $hListViewHeader = _GUICtrlListView_GetHeader(GUICtrlGetHandle($hListView)) ; Add columns _GUICtrlListView_AddColumn($hListView, "Column 1", 100) _GUICtrlListView_AddColumn($hListView, "Column 2", 100) _GUICtrlListView_AddColumn($hListView, "Column 3", 100) GUICtrlCreateListViewItem('a|b|c', $hListView) ; Change column $aInfo = _GUICtrlListView_GetColumn($hListView, 0) _GUICtrlListView_SetColumn($hListView, 0, "New Column 1", 150, 2) _GUICtrlHeader_SetItemAlign($hListViewHeader, 0, 1) GUISetState() ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
rasim Posted August 14, 2008 Posted August 14, 2008 Simple trick: #include <GuiConstantsEx.au3> #include <GuiListView.au3> GUICreate("ListView Set Column", 400, 300) $hListView = GUICtrlCreateListView("", 2, 2, 394, 268) $hListViewHeader = _GUICtrlListView_GetHeader(GUICtrlGetHandle($hListView)) ; Add columns _GUICtrlListView_AddColumn($hListView, "Column 1", 100) _GUICtrlListView_AddColumn($hListView, "Column 2", 100) _GUICtrlListView_AddColumn($hListView, "Column 3", 100) GUICtrlCreateListViewItem('a| b| c', $hListView) ; Change column $aInfo = _GUICtrlListView_GetColumn($hListView, 0) _GUICtrlListView_SetColumn($hListView, 0, "New Column 1", 150, 2) GUISetState() ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete()
Achilles Posted August 14, 2008 Author Posted August 14, 2008 Simple trick: #include <GuiConstantsEx.au3> #include <GuiListView.au3> GUICreate("ListView Set Column", 400, 300) $hListView = GUICtrlCreateListView("", 2, 2, 394, 268) $hListViewHeader = _GUICtrlListView_GetHeader(GUICtrlGetHandle($hListView)) ; Add columns _GUICtrlListView_AddColumn($hListView, "Column 1", 100) _GUICtrlListView_AddColumn($hListView, "Column 2", 100) _GUICtrlListView_AddColumn($hListView, "Column 3", 100) GUICtrlCreateListViewItem('a| b| c', $hListView) ; Change column $aInfo = _GUICtrlListView_GetColumn($hListView, 0) _GUICtrlListView_SetColumn($hListView, 0, "New Column 1", 150, 2) GUISetState() ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() That doesn't work if the user resizes the columns which they'll be able to do in this program. I thought there might be a way of applying a setting only to the header of the listview and not all of it... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now