 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Adam Guest
|
Posted: Thu Jun 24, 2004 9:59 am Post subject: How to make SubItemImages of TListView visible? |
|
|
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
|
Posted: Thu Jun 24, 2004 2:36 pm Post subject: Re: How to make SubItemImages of TListView visible? |
|
|
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 |
|
 |
|
|
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
|
|