Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - ListView report view autosize columns
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ListView report view autosize columns

 Post Reply Post Reply
Author
Message
TomasS View Drop Down
Groupie
Groupie
Avatar

Joined: 28 January 2009
Location: Sweden
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote TomasS Quote  Post ReplyReply Direct Link To This Post Topic: ListView report view autosize columns
    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
Back to Top
TomasS View Drop Down
Groupie
Groupie
Avatar

Joined: 28 January 2009
Location: Sweden
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote TomasS Quote  Post ReplyReply Direct Link To This Post Posted: 03 January 2012 at 7:33am
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
Back to Top
TomasS View Drop Down
Groupie
Groupie
Avatar

Joined: 28 January 2009
Location: Sweden
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote TomasS Quote  Post ReplyReply Direct Link To This Post Posted: 03 January 2012 at 9:53am
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.