MFC Tree Control: How to add checkboxes to a tree control?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: MFC Tree Control: How to add checkboxes to a tree control?

  1. #1
    Join Date
    Jun 2001
    Location
    Switzerland
    Posts
    4,443

    MFC Tree Control: How to add checkboxes to a tree control?

    Q: How to add checkboxes to a tree control?

    A:

    • At design time, use the resource editor to enable the "Check boxes" style.

    • At run-time, add the 'TVS_CHECKBOXES' style to the tree control, after you have created it and before you have populated it.

      Code:
      DWORD dwLong = m_tree.GetWindowLong(GWL_EXSTYLE);
      dwLong |= TVS_CHECKBOXES;
      m_tree.SetWindowLong(GWL_EXSTYLE, dwLong);


    Last edited by Andreas Masur; July 25th, 2005 at 03:55 PM.

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center