How to Display Icon on the ListCtrl??? 
Author Message
 How to Display Icon on the ListCtrl???

I've been trying to set an Icon on my List Control and I coulden figure out how
to do that ,do I have to create Image list first or I can display Icon without
it ???

Please Help !!



Tue, 07 Aug 2001 03:00:00 GMT  
 How to Display Icon on the ListCtrl???

Quote:

>I've been trying to set an Icon on my List Control and I coulden figure out
how
>to do that ,do I have to create Image list first or I can display Icon
without
>it ???

>Please Help !!

I have made a list control with icons that are displayed to the right of the
text in the list control.

Here is some of my code.

    //Here I create the list control.
    m_ListControl.Create(LVS_REPORT, rClientRectangle, sg_cwnd,
        100);

    //This state causes the window to be draw.
    m_ListControl.ShowWindow(SW_SHOW);

    //Create Images.
    //At this point, I am loading the Icon for the first column of
    //the list control.  The icon should resemble a bin.
    //Small icons are 16 x 16 pixels.
    /*****************************************************************
    *       Here is the definition of m_SmallIcon.
    *       CImageList m_SmallIcon;
    *****************************************************************/
    m_SmallIcon.Create((::GetSystemMetrics(SM_CXICON) / 2),
        (::GetSystemMetrics(SM_CYICON) / 2), TRUE, 10, 10);

    //Initialize the elements.  IDI_BIN_ICON is an icon that I created with
    //the icon editor.
    iImageIndex =
        m_SmallIcon.Add(AfxGetApp()->LoadIcon(IDI_BIN_ICON));

    //Connect the Image list to the list view.
    m_ListControl.SetImageList(&m_SmallIcon, LVSIL_SMALL);



Sat, 18 Aug 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Icons: Displaying other than the standard MFC icon

2. Displaying a bitmap vs. displaying its icon

3. Animate icons in ListCtrl

4. Animate icons in ListCtrl

5. ListCtrl Item Icon Index

6. Getting icons in ListCtrl from DLL

7. HowTo:Change icon in Listctrl

8. Icons in ListCtrl?

9. ListCtrl and Icon loading

10. Display ListCtrl in main window

11. Any way to make ListCtrl display 8bit bitmaps?

12. Copying Selected Item from listctrl to 2nd listctrl

 

 
Powered by phpBB® Forum Software