CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 1999
    Posts
    6

    CListCtrl problem



    In a list control, can a subitem contain an image. I can't seem to get this to work. If possible, I don't understand

    why following code doesn't work:

    //m_icons is CImageList

    m_icons.Create( 16, 16, ILC_COLOR, 5, 5 );

    m_icons.Add( AfxGetApp()->LoadIcon( IDI_ICON1 ) );

    m_icons.Add( AfxGetApp()->LoadIcon( IDI_ICON2 ) );

    m_listCtrl.SetImageList( &m_icons, LVSIL_SMALL );

    m_listCtrl.InsertColumn( 0, "Name", LVCFMT_CENTER, 50, 0 );

    m_listCtrl.InsertColumn( 1, "Description", LVCFMT_LEFT, 100, 1 );

    m_listCtrl.InsertItem( 0, "Marcus", 0 );

    m_listCtrl.SetItem( 0, 1, LVIF_IMAGE, NULL, 0, 0, 0, 0 );




  2. #2
    Join Date
    Apr 1999
    Posts
    20

    Re: CListCtrl problem



    Owner draw...look at the list control section here on CodeGuru for some examples of how to do this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured