ListView report view autosize columns |
Post Reply |
Author | |
TomasS
Groupie Joined: 28 January 2009 Location: Sweden Status: Offline Points: 47 |
Post Options
Thanks(0)
Posted: 03 January 2012 at 6:58am |
I'm in the process of replacing VB listviews with the CJ version. I now have problems getting the columns to autosize. There is no autosize property in either the VB, or CJ listview but in VB I have used the method to send LV_SETCOLUMNWIDTH messages to the control with column index as lparam and -2 as wparam. This has worked great with the VB listview both for the columnheaders and item, subitem text. In the CJ version it does not work for the column headers only for the data text. This is no good since the column header text gets ellipsed and any sortorder arrow gets hidden...
Does anyone know any workaround or fix for this? Could CJ add Autosize to the ListView? Now speculating: Since I suspect the CJ ListView is based on the native ListView but column headers are manually drawn on top of it, that may be the root cause for the behavior. The messages I send arrange the columns fine, but the native control behind the scenes has no text in its column headers. Therefore the headers are not considered in the autosizing.
|
|
Xtreme SuitePro (ActiveX) version 17.3.0, 16.3.1
Windows 10 64-bit Visual Basic 6.0 |
|
TomasS
Groupie Joined: 28 January 2009 Location: Sweden Status: Offline Points: 47 |
Post Options
Thanks(0)
|
One change: The sort order arrow is not hidden. It however hides even more of the column header text due to the problem described in one other popular post:
|
|
Xtreme SuitePro (ActiveX) version 17.3.0, 16.3.1
Windows 10 64-bit Visual Basic 6.0 |
|
TomasS
Groupie Joined: 28 January 2009 Location: Sweden Status: Offline Points: 47 |
Post Options
Thanks(0)
|
Well, I got the LV_SetColumnWidth -2 trick actually works fine if you have SendMessage properly declared with wParam as Long in VB6... I had a declaration with As Any for some purpose... Now it does consider the column header text.
However the problem with the sort order arrow remains. After setting the column width the sort order arrow will make the header ellipsed. Not nice. I would appreciate a solution to the original problem with the sort order arrow as described in my last reply to the 18454 post. (see link above)
|
|
Xtreme SuitePro (ActiveX) version 17.3.0, 16.3.1
Windows 10 64-bit Visual Basic 6.0 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |