Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: Z-Order

104| Sat, 01 Dec 2007 03:41:00 GMT| arc| Comments (3)
I need to know how to get a label to stay on top of a picture box.

I set the Zorder of the label to 0 but the picture box still covers it. When i use an Imagebox the label stays on top, But, the imagebox gives a crappy flickering effect when it moves so i have to use a picturebox.

Is this possible?

Keywords & Tags: z-order, microsoft, visual basic, vb

URL: http://www.programmerbase.com/visual-basic/560827/
 
«« Prev - Next »» 3 helpful answers below.
Hi
The label control (and lines, shapes etc) is directly drawn on the form hence the label can never be on top of the picture box UNLESS it is within the picture box.

So, at design time u could create the control within the picture box by just drawing it there OR if u already have the control on the form, cut it (Ctrl-X) and then click on the Picture box and paste it (Ctrl-V)

At runtime...

Set Label1.Container = Picture1

regards
Stuart

beachbum | Wed, 05 Dec 2007 00:07:00 GMT |

Thanks alot but i can't go with the container idea because the label has to appear to float above the moving Picture box.

If only there were some way to reduce the flicker of an image box.../sigh

arc | Wed, 05 Dec 2007 00:08:00 GMT |

Hi
Picture boxes dont flicker very much at all. So, u could either put ur label in its own seperate 'floating' picture box or print directly to that floating picture box. If the Zorder of that picture box is set then it will appear in front of all other controls in the form.
Regards
Stuart

beachbum | Wed, 05 Dec 2007 00:09:00 GMT |

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories