By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,678 Members | 1,920 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,678 IT Pros & Developers. It's quick & easy.

Need ghost label to appear over Derived TreeView

P: n/a
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
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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"????
Nov 15 '05 #2

P: n/a
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.
Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.