Solved

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

Posted on 1999-01-21
4
163 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
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sum28 challenge 31 112
Fibonacci challenge 11 122
Sed question 2 85
"Black Box" Testing of Control System Software 2 51
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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

772 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