nullschritt Posted July 7, 2013 Share Posted July 7, 2013 Hello all I have been using the following function to resize my listview to show all text. func _sizeconvolist() GUICtrlSendMsg($convolist, $LVM_SETCOLUMNWIDTH, 0, -1) ; $LVSCW_AUTOSIZE GUICtrlSendMsg($convolist, $LVM_SETCOLUMNWIDTH, 0, -2) ; $LVSCW_AUTOSIZE_USEHEADER EndFunc It works great until I do _GUICtrlListView_BeginUpdate($convolist) _GUICtrlListView_DeleteAllItems($convolist) _GUICtrlListView_InsertItem($convolist, "Some Text") _sizeconvolist() _GUICtrlListView_EndUpdate($convolist) _sizeconvolist() After this point, the listview no longer auto resizes, anyone have any idea why? Link to comment Share on other sites More sharing options...
Gianni Posted July 7, 2013 Share Posted July 7, 2013 (edited) Hi nullschritt why you use _sizeconvolist() before AND after _GUICtrlListView_EndUpdate($convolist) and not only after? anyway, have You tried with _GUICtrlListView_SetColumnWidth($hWnd, $iCol, $iWidth) as BrewManNH suggested you in this >post? EDIT: from the autoit help for _GUICtrlListView_SetColumnWidth: using $LVSCW_AUTOSIZE as value for $iWidth, Automatically sizes the column. bye Edited July 7, 2013 by Pincopanco Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
michaelslamet Posted July 7, 2013 Share Posted July 7, 2013 Hi, I would doing something like this: _GUICtrlListView_SetColumnWidth($convolist, 0, $LVSCW_AUTOSIZE) If _GUICtrlListView_GetColumnWidth($convolist, 0) < $default_listview_width Then _GUICtrlListView_SetColumnWidth($convolist, 0, $default_listview_width) EndIf $default_listview_width is your const, it's the default width when create the ListView Link to comment Share on other sites More sharing options...
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