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

Thread: Listview Insert Column

  1. #1
    Join Date
    Feb 2002
    Posts
    97

    Listview Insert Column

    In a Dialog App I am working on populating a listview control

    LV_COLUMN lvColumn;
    lvColumn.mask =LVCF_FMT|LVCF_WIDTH|LVCF_TEXT|LVCF_SUBITEM;
    lvColumn.fmt=LVCFMT_CENTER;
    lvColumn.cx=75;

    lvColumn.iSubItem=0;
    lvColumn.pszText="Test";
    m_lvListView.InsertColumn(0,&lvColumn);

    InsertColumn does not appear to be a member.

    How does one add a Column to a Dialog ListView?

    Thanks,
    Doug



  2. #2
    Join Date
    Jan 2002
    Location
    Scaro, UK
    Posts
    5,940

    Re: Listview Insert Column

    Are we talking about a CListView class here ?

    If so, the list control's class can be accessed
    like this


    // inside of the CListView
    GetListCtrl().InsertColumn(... blah blah);

    // outside of CListView
    m_pView->GetListCtrl().InsertColumn




    Hope this helps,

    Darwen.


    www.pinvoker.com - PInvoker - the .NET PInvoke Interface Exporter for C++ Dlls.

  3. #3
    Join Date
    Aug 2001
    Location
    Minnesota, USA
    Posts
    801

    Re: Listview Insert Column

    Are you sure you've got a CListCtrl and not a CListBox? Maybe a dumb question, but I see no other reason why a variable of type CListCtrl would not compile, when it clearly does have an InsertColumn member.

    Chris Richardson

    http://www.geometriccomputing.com
    http://www.imagesensing.com
    http://www.autoscope.com

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center