CListView columns ideal size
-
Hi:) Beginer question (I think;) - how to make my CListView columns (I use a report view) to fill in all available list width? (without adding scrollbar control at the bottom). When I use m_ListView.GetClientRect() and then set my two columns width to the 1/2 of the returned value, I still get a scroll bar at the bottom...?!? (couple of pixels, but still...) Is it possible to remove the last column's separator?? I could just shrink last column by 2-4 pixels and remove its ending separator to look nice;) How to do it?? Thanks for any help/comment.
-
Hi:) Beginer question (I think;) - how to make my CListView columns (I use a report view) to fill in all available list width? (without adding scrollbar control at the bottom). When I use m_ListView.GetClientRect() and then set my two columns width to the 1/2 of the returned value, I still get a scroll bar at the bottom...?!? (couple of pixels, but still...) Is it possible to remove the last column's separator?? I could just shrink last column by 2-4 pixels and remove its ending separator to look nice;) How to do it?? Thanks for any help/comment.
PatrykDabrowski wrote:
Is it possible to remove the last column's separator?? I could just shrink last column by 2-4 pixels and remove its ending separator to look nice;) How to do it??
You can use
SetColumnWidth
or specify the width when creating columns.
Nibu thomas A Developer Programming tips[^] My site[^]
-
PatrykDabrowski wrote:
Is it possible to remove the last column's separator?? I could just shrink last column by 2-4 pixels and remove its ending separator to look nice;) How to do it??
You can use
SetColumnWidth
or specify the width when creating columns.
Nibu thomas A Developer Programming tips[^] My site[^]
Yes, I'm already using SetColumnWidth(). My code works like this: 1) Get listView width by calling GetClientRect() 2) Call SerColumnWidth() for each (two in my case) column, setting (1/2*width) and (width-1/2*width) ...and still a scrollbar control appears at the bottom of my ListView control...?!?
-
Yes, I'm already using SetColumnWidth(). My code works like this: 1) Get listView width by calling GetClientRect() 2) Call SerColumnWidth() for each (two in my case) column, setting (1/2*width) and (width-1/2*width) ...and still a scrollbar control appears at the bottom of my ListView control...?!?
PatrykDabrowski wrote:
...and still a scrollbar control appears at the bottom of my ListView control...?!?
There are some styles that you may like to look into LVS_NOSCROLL but this disables scrolling. Maybe you can pull the last column little bit more inside. :)
Nibu thomas A Developer Programming tips[^] My site[^]
-
PatrykDabrowski wrote:
...and still a scrollbar control appears at the bottom of my ListView control...?!?
There are some styles that you may like to look into LVS_NOSCROLL but this disables scrolling. Maybe you can pull the last column little bit more inside. :)
Nibu thomas A Developer Programming tips[^] My site[^]
Yes, that's what I'm going to do - reduce last column by 2-4pixels...but that's some kind of a 'hack';) The goal is to create this listview without the scrollbar at the bottom but not by using LVS_NOSCROLL, but by resizing the columns. Of course the scrollbar should appear if I decrease the whole dialog window or change the column width using mouse.... Thanks for help anyway:)
-
Yes, that's what I'm going to do - reduce last column by 2-4pixels...but that's some kind of a 'hack';) The goal is to create this listview without the scrollbar at the bottom but not by using LVS_NOSCROLL, but by resizing the columns. Of course the scrollbar should appear if I decrease the whole dialog window or change the column width using mouse.... Thanks for help anyway:)
Use LVSCW_AUTOSIZE_USEHEADER for the cx param when you set the size of the LAST column.