Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 691041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:29:55+00:00 2026-05-14T02:29:55+00:00

I have searched through internet & found that there are no any direct method

  • 0

I have searched through internet & found that there are no any direct method that disable nodes of CTreeCtrl control.

check one post at http://www.ucancode.net/faq/MFC_CTreeCtrl-CListCtrl.htm & also on codeguru.com but not clear about how to disable node of CTreeCtrl.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:29:55+00:00Added an answer on May 14, 2026 at 2:29 am

    Well, I think, the article you linked, speaks the truth: It’s not possible (at least not for Windows versions before Vista, see below). You have to program the workarounds recommended in the link to “simulate” item disabling. It means: Give the item a specific colour (light grey for instance) and catch all the events which can occur on a TreeView item and cancel the actions (like expanding/collapsing a node, and so on).

    Here, http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/3350ba1e-1fcf-47fe-ab6b-e20c6b5afd91, the statement of the article is more or less confirmed by Microsoft experts. They recommend the same workaround (and actually link to the same article). Also note the link to http://www.codeproject.com/KB/tree/colortreectrl.aspx on how to change individual item colors which might help if you really want to start programming the workaround.

    “More or less confirmed” means: There seems to be an exception for Vista and higher:

    “CTreeCtrl::SetItemStateEx() supports TVIS_EX_DISABLED (described in TVITEMEX structure) style which disables treectrl node. But its only supported from Vista onwards.”

    I’ve seen that sometimes it is talked about a possible value TVIS_DISABLED of the state flag of the TVITEM structure and actually the MSDN of the old VC6 compiler contains a technical article (from 1994 before release of Windows 95 ;)) which says that such a state value should exist with the meaning: "The item is disabled and is drawn using the standard disabled style and color." This article was preliminary ("Please note that this article is based on preliminary information that is subject to change before the final version of Windows 95.") and obviously this value for item disabling did not make its way into the final release of Windows95 as you cannot find it in any VC header files.

    So either you can make sure that your program is only used on Vista or higher computers (then it’s probably easy with the extended state flag above) or it will be an ugly work (though doable and not necessarily very difficult).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched around, and it seems that this is a limitation in MS
I've searched the Internet for a while now and I have not been able
I have searched but apparently my google foo is weak. What I need is
I've have searched on this and it seems to be a catch all, unfortunately
How can I find the parameters of an undocumented Dll function? I have searched
I've searched for this a little but I have not gotten a particularly straight
I have a form that searches all rows in a single table (TServices) that
I have a Flex application that calls a function which searches a large document
I have a live search on my help page that searches our help database
I'm trying to optimize my C++ code. I've searched the internet on using dynamically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.