CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Dec 2005
    Posts
    445

    Adding columns to CListCtrl

    Hi all,

    I'm adding 12 columns to a list control as follows:

    Code:
                    LVCOLUMN lvColumn;
    	int i=0; 
    
                    lvColumn.iImage = 1; 
    	lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_IMAGE | LVCF_WIDTH;
    	lvColumn.fmt = LVCFMT_BITMAP_ON_RIGHT | LVCF_IMAGE;
    	lvColumn.cx = 100;
    	lvColumn.pszText = "Column 1";
    	if ( m_ListCtrlCallsHistory.InsertColumn( i++, &lvColumn ) == -1 )
    	    return FALSE;
    
    
    	lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_IMAGE | LVCF_WIDTH;
    	lvColumn.fmt = LVCFMT_BITMAP_ON_RIGHT | LVCF_IMAGE;
    	lvColumn.cx = 130;
    	lvColumn.pszText = "Column 2";
    	if ( m_ListCtrlCallsHistory.InsertColumn( i++, &lvColumn ) == -1 )
    	    return FALSE;
    
                    // Adding Column 3,4,5,6,7,.....
    I've specified that I would like the icon to be on the right hand side of the text and it seems to work fine for all the columns execept of the first 1.

    Can someone please explain how can I put my image on the right side of the text in the first column???

    Many thanks!!!!
    Last edited by Salvadoravi; August 10th, 2009 at 10:29 AM.

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