?
Solved

How to add /delete  "+"   Symbol in TreeView for an empty tree Item

Posted on 1999-01-21
4
Medium Priority
?
169 Views
Last Modified: 2013-11-20
2) A question in TreeCtrl ......
 
In Windows Explorer , u will see a "+" sign just before a empty Directory and when u click on the "+" sign the "+" sign disappears showing that directory is empty !!!
 
I would like to implement something like that .... is there any extended flag available for the above method ????

thanks
senthil
0
Comment
Question by:senthil_k
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 1328169
No, just add a dummy child to the tree node. When the user clicks on the node, you get a notification. In the response to this notification, if you delete the empty node, then you'll get the disappearing +.
0
 

Author Comment

by:senthil_k
ID: 1328170
Hi Thui,
Thanks for ur suggestion as I am aleady doing that trick !!!!
I have come across a member of TVITEM Structure named cChildren and if u specify the value of cChildren to  1 then the treeview displays a "+" sign by default assuming that there will be one or more child items for that parent Item...but when I click on that Parent Item the "+" symbol does not disappear !!!!

If u have any suggestions regarding the above method !!! please mail back to me ....

thanks
senthil
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1328171
You should not set the children count to 1 because this will confuse the control. Instead, as I suggested, insert a dummy child item. You then need to respond to TVN_ITEMEXPANDING and delete the dummy child control.
0
 

Author Comment

by:senthil_k
ID: 1328172
Thanks for ur suggestion as u r right If I try to assign 0 to a particular item, tree control removes the "+" sign of other tree items which has children item .......it does it randomly ..as u say it gets cinfused !!!!!!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question