• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

List View

How can I create a report view which look like the explorer right pane. I was able to create the list view. But, the images in the extreme left are not coming.
0
vasu_i
Asked:
vasu_i
1 Solution
 
inprasCommented:
Hi
Declare a object of CImageList in dialog.h say m_Images
Add the control variable to the list view say m_ctrlList
in OnInitDialog do the following thing

      m_Images.Create(16,16,0,0,2);
      HICON icon = LoadIcon(0, IDI_QUESTION);
      m_Images.Add(icon);
      icon = LoadIcon(0, IDI_WINLOGO );
      m_Images.Add(icon);

      m_ctrlList.SetImageList(&m_Images, LVSIL_SMALL);

      //m_ctrlList.InsertItem(0,"56");
      LV_ITEM lvitem;
      lvitem.iItem = 0;
      lvitem.iSubItem = 0;
      lvitem.pszText = "er";  
      lvitem.mask = LVIF_IMAGE | LVIF_TEXT;
      lvitem.state = lvitem.stateMask = LVIS_STATEIMAGEMASK ;
      lvitem.iImage = 0;
      m_ctrlList.InsertItem(&lvitem);
Hope this helps
Regards
0
 
vasu_iAuthor Commented:
Hi,

I got the problem rectified. The problem is I am giving the Image List with 32 x 32 icons.

Thanx.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now