471,591 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,591 software developers and data experts.

Need ghost label to appear over Derived TreeView

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.
Nov 15 '05 #1
2 2609
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
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.

Similar topics

2 posts views Thread by Bonj | last post: by
4 posts views Thread by hzgt9b | last post: by
reply views Thread by nevin | last post: by
1 post views Thread by Tim Marshall | last post: by
2 posts views Thread by =?Utf-8?B?QWxleCBLLg==?= | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.