Assuming that all the listitems in the listview not exceed the maximum item
count in the visible area of the listview i guess your code look ok. If not
that will cause the vertical scroll bar to appear and of course you will
need to recalculate the second column heard and taking into account that the
new width now should include the vertical scrollbar width. (i think it is 15
pixels)
For example: say i have a listview, width = 500, height = 500, maximum item
display in visible area: 10. Here is my code
//Assuming the columnheader[0] default = 450;
if (listview.items.count 10)
{
//This will force the listview not to show the horizontal bar but
//still keeping vertical bar. 15 is an assumtion of the vertical bar
width.
listview.columnheader[0].width = 450 - 15;
}
else
{
listview.columnheader[0].width = 450 ;
}
"John Kraft" <jh*****@barbecueguy.comwrote in message
news:11********************************@4ax.com...
On Tue, 25 Jul 2006 11:27:43 +1200, "thi" <th******@hotmail.com>
wrote:
>>What scrollbar are we talking about? Horizontal or vertical. My guess is
the
the column header width is longer then the listview width itself which
cause
the horizontal bar to appear and that could result the vertical bar to
appear too.
Can't really tell without seeing what exactly going on.
I'm sorry for not being specific enough. It is the horizontal scroll
bar that appears. I have calculated the width of the columns (there
are only 2 columns) like this:
col2Width = listview.Width - col1Width - 4; // 2 pixel border
This seems to work just fine most of the time; however, sometimes the
h scrollbar appears. The only time it is consistently reproducable is
when going from maximized to normalized. The rest of the times it
seems to be random, and clicking on the right scroll button causes it
to disappear. I have tried making my pixel border cushion bigger, but
that doesn't seem to effect it. It's almost as if the calculations
are not being performed each time, or the calculation is somehow
fractional and thereby rounding up. *shrug*
Thanks,
john