mpower Posted June 19, 2014 Share Posted June 19, 2014 So I've posted about this before but never really received a response. I'm trying to increase the HEIGHT of the ListView header. I've found a stackoverflow post about it, but it relates to C# and Visual Studio. (http://stackoverflow.com/questions/3904572/c-sharp-listview-colum-header-height-windows-form) Unfortunately it is beyond my Autoit Scripting skills to convert/adapt it for Autoit. Would anyone care to attempt to achieve this in Autoit? Sample Script below: #include <GUIConstants.au3> $iWidth = 800 $iHeight = 600 GUICreate('ListView Header Example', $iWidth, $iHeight, @DesktopWidth/2 - $iWidth/2, @DesktopHeight/2 - $iHeight/2) $listview = GUICtrlCreateListView('Short header text1|Short header text2|Short header text3|Short header text5|Short header text5|Long header that needs to span accross multiple lines rather than extending column width', 10, 10, $iWidth - 20, $iHeight - 20, _ Default, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Humble thanks in advance. Link to comment Share on other sites More sharing options...
Zedna Posted June 19, 2014 Share Posted June 19, 2014 (edited) Just for the reference, here is reference for related HDM_LAYOUT header message: http://msdn.microsoft.com/en-us/library/windows/desktop/bb775353%28v=vs.85%29.aspx Here it's mentioned in old topic on this forum (with nice example) Edited June 19, 2014 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
mpower Posted June 19, 2014 Author Share Posted June 19, 2014 (edited) Thanks Zedna for the additional information, I have seen that post before also but it went over my head I have looked into it a bit more and I have at least confirmed that sizing the header is possible with WinMove, for example: #include <GUIConstants.au3> #include <GuiListView.au3> $iWidth = 800 $iHeight = 600 GUICreate('ListView Header Example', $iWidth, $iHeight, @DesktopWidth/2 - $iWidth/2, @DesktopHeight/2 - $iHeight/2) $listview = GUICtrlCreateListView('Short header text1|Short header text2|Short header text3|Short header text5|Short header text5|Long header that needs to span accross multiple lines rather than extending column width', 10, 10, $iWidth - 20, $iHeight - 20, _ Default, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)) $header = HWnd(_GUICtrlListView_GetHeader($listview)) WinMove($header, '', Default, Default, Default, 100) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd However, with above example, the header position doesn't look right, the text doesn't get wrapped and any time you resize a column the header reverts back to standard header height. I suspect some sort of GUIRegisterMsg() is required to get this to work properly. More work is needed. Edited June 20, 2014 by mpower Link to comment Share on other sites More sharing options...
mpower Posted July 10, 2014 Author Share Posted July 10, 2014 seeing if anyone can help with this still? cheers! 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