Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need "ghost" label to appear above derived TreeView.

Status
Not open for further replies.

tenshekels

Programmer
Feb 5, 2004
20
US
I have been using a label with the TreeView control - to simulate the ghost image of a node during drag/drop (so that a ghost of the node appears to be floating next to the cursor on a drag/drop).

This works peachy when I had a form that used the TreeView control (from Microsoft).
The time came that I needed to change the TreeView - so I created a control that inherited from the TreeView class.

Now with this derived class, everything works - except for the fact that the "ghost" label will not appear over my derived tree view. I know that I am setting the position right, because if I move the cursor to the far right side of the derived TreeView control I can see the "ghost" label. However the "ghost" label refuses to render itself over the derived TreeView class. I have compared all of the properties between my TreeView and derived TreeView controls and they are the same....

Does anyone have any idea???

Thanks very much.
Peter
 
I placed the label over the control and realized that it's zorder must be behind the control. So I used the "Send to Front" option in the design view to fix the problem.

However, this still doesn't really make me happy. Why doesn't Microsoft allow you to do this programatically through some property? If you create a label control through code (not design view), then how do you set this property to "Bring to Front"????

 
Duh... I needed the ".BringToFront" method.
Sorry for my stupidness.

One thing I was trying to do was to have a label control inside my derived TreeView class and to have that label control appear in front of the rest of the image. I still couldn't get that to happen - even with the ".BringToFront" method. I guess I will need to pass a reference to the label in via a function, set the ".BringToFront", and manipulate it's position in the derived control.
 
amazing.. a problem resolved entirely by yourself =)
in 3 posts, no less..
 
Not entirely solved...

I am still unsatisfied that I can not have a label control inside the derived TreeView class and have that render in front over the rest of the TreeView structure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top