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 

How to make SubItemImages of TListView visible?

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





PostPosted: Thu Jun 24, 2004 9:59 am    Post subject: How to make SubItemImages of TListView visible? Reply with quote



Hi all,

Using BCB6 cannot TListView seems to not display checkboxes
(ListView1->Checkboxes=true) and subitem images
(ListView1->Items->Item[x]->SubItemImages[y]=z) simultanously. Is there any
particular reason why it doesn't do that? SubItemImages are supposed to be
displayed as a part of SubItems therefore the do not interfere with
checkboxes located on the very left side of each row (Item) of the ListView.

How can I show images in subitems cell and have checkboxes visible too?

IBM T40/Win2000/Borland C++ Builder 6 Enterprise


Thanks
AV


Back to top
Damon Chandler (TeamB)
Guest





PostPosted: Thu Jun 24, 2004 2:36 pm    Post subject: Re: How to make SubItemImages of TListView visible? Reply with quote



Hi Adam,
IIRC, the TListView class doesn't handle the LVN_GETDISPINFO message
correctly, which causes the checkboxes to disappear whenever you specify
a subitem's image. To workaround this, don't use the SubItemImages[]
property; rather, use the following approach...

// ensure that the necessary styles are set
LONG flags = 0;
ListView1->Perform(LVM_GETEXTENDEDLISTVIEWSTYLE, 0, flags);
flags |= LVS_EX_SUBITEMIMAGES | LVS_EX_CHECKBOXES;
ListView1->Perform(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, flags);

// specify an image for a subitem
LV_ITEM lvi;
ZeroMemory(&lvi, sizeof(LV_ITEM));
lvi.mask = LVIF_IMAGE;
lvi.iItem = 0; // row index
lvi.iSubItem = 1; // column index
lvi.iImage = 2; // image index (SmallImages)
ListView_SetItem(ListView1->Handle, &lvi);

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


Adam wrote:
Quote:
How can I show images in subitems cell and have checkboxes visible too?

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.