BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TListView Column width when ViewStyle is vsList

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Richard Luteijn
Guest





PostPosted: Wed Mar 23, 2005 12:04 am    Post subject: TListView Column width when ViewStyle is vsList Reply with quote



Hi there,

I'm using a TListView to display some items (smallimage and text). I've set
the ViewStyle to vsList since i want the items to wrap around to the next
column. The text of the items change constantly due to the (networked) users
changing them. This works fine.

The problem is that i cannot seem to set the width of the 'columns' since
there are no colums for a vsList style. Even with a clientwidth of 1000 and
only one item in the list, the list shows "This is an item in a TLis..." and
cuts off the text, instead of showing "This is an item in a TListView that
has the vsList Style".

The clipped width is not somtething like: clientwidth / 1,2 or 3. Since when
the ListView is 400 pixels wide, the clipped text can be 361 pixels wide.

Is there a way to set the (minimum) column width ?

Also, is there a way to set the (background) color for a selected item when
the list has no focus and HideSelection is false ? The default Silver
background color doesn't do it for me.

Thanks in advance,
Richard


Back to top
Damon Chandler (TeamB)
Guest





PostPosted: Sat Mar 26, 2005 4:08 am    Post subject: Re: TListView Column width when ViewStyle is vsList Reply with quote



Hi Richard,
You can use the ListView_SetColumnWidth() macro (which will send the
list view the LVM_SETCOLUMNWIDTH message) to specify a new, fixed column
width...

int const new_width = 500; // pixels
ListView_SetColumnWidth(ListView1->Handle, 0, new_width);

The docs on the macro/message are here: http://tinyurl.com/473kl.

Good luck,
--
Damon (TeamB)
C++Builder Developer's Journal
http://bcbjournal.com


Richard Luteijn wrote:
Quote:
The problem is that i cannot seem to set the width of the 'columns' since
there are no colums for a vsList style.

Back to top
Richard Luteijn
Guest





PostPosted: Sun Mar 27, 2005 4:23 pm    Post subject: Re: TListView Column width when ViewStyle is vsList Reply with quote



Hi Damon,

Thank you very much for you info, it works exactly like i hoped for.

Richard


"Damon Chandler (TeamB)" wrote in message
news:4244e04a$1 (AT) newsgroups (DOT) borland.com...

Quote:
Hi Richard,
You can use the ListView_SetColumnWidth() macro (which will send the
list view the LVM_SETCOLUMNWIDTH message) to specify a new, fixed column
width...

int const new_width = 500; // pixels
ListView_SetColumnWidth(ListView1->Handle, 0, new_width);

The docs on the macro/message are here: http://tinyurl.com/473kl.

Good luck,
--
Damon (TeamB)
C++Builder Developer's Journal
http://bcbjournal.com




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.