pizzaking 0 Posted May 26, 2005 Hi everyone! Can i auto-resize the columns of a listview? When I fill in the listviewitems, the columns don't change their size. After all the listviewitems are in the listview, I have to double click the seperators in the column-header, which resizes the column to a perfect width. Is there a way to perform the resize in the script? Thanks in advance pizzaking Share this post Link to post Share on other sites
Jos 2,165 Posted May 26, 2005 Hi everyone!Can i auto-resize the columns of a listview?When I fill in the listviewitems, the columns don't change their size.After all the listviewitems are in the listview, I have to double click the seperators in the column-header, which resizes the column to a perfect width.Is there a way to perform the resize in the script?Thanks in advancepizzaking<{POST_SNAPBACK}>Did you try _GUICtrlListViewSetColumnWidth() which is avialble in the latest Beta .... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
pizzaking 0 Posted May 26, 2005 I was able to help myself with$GUI = GUICreate(..) $LIST_VIEW = GuiCtrlCreateListView(..) .. ControlFocus ( $GUI, "", $LIST_VIEW ) Send("{DOWN}^{NUMPADADD}") ..But there might be a better way with GUICtrlSendMsg, LVM_SETCOLUMNWIDTH and LVSCW_AUTOSIZE as described in the MSDN Library, but I cant figure out how. Anyway: the code above works fine for me.@JdeB : Thanks for the reply, I didn't try it, because I still don't have the new beta. But it sounds very good (and GUICtrlSendMsg shouldn't be needed). I will try later!pizzaking Share this post Link to post Share on other sites
SumTingWong 1 Posted May 26, 2005 (edited) But there might be a better way with GUICtrlSendMsg, LVM_SETCOLUMNWIDTH and LVSCW_AUTOSIZE as described in the MSDN Library, but I cant figure out how. Global Const $LVM_FIRST = 0x1000 Global Const $LVM_SETCOLUMNWIDTH = $LVM_FIRST+30 Global Const $LVSCW_AUTOSIZE = -1 Global Const $LVSCW_AUTOSIZE_USEHEADER = -2 ; Your code here ; To resize to widest value GUICtrlSendMsg($listviewhandle, $LVM_SETCOLUMNWIDTH, $columnindex, $LVSCW_AUTOSIZE) ; To resize to column header GUICtrlSendMsg($listviewhandle, $LVM_SETCOLUMNWIDTH, $columnindex, $LVSCW_AUTOSIZE_USEHEADER)$columnindex is zero-based Edited May 26, 2005 by SumTingWong Share this post Link to post Share on other sites