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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A question about the ordering of controls 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi!
I'm facing a peculiar problem. I'm having a picturebox control and other controls in my form. The picturebox control is not allowing me to paste controls above it. That is the picturebox control is not going to back of the controls.

I've used Zorder also but is not working. I can't use Image control in this case coz i'm using the picturebox control as a container.

Can anyone help me.

Thanq

ARAVINDA SARMA
 
Are you pasting the controls dynamically during execution?

I added a CommandButton on top of a PictureBox (set with a picture) at design time and I didn't experience difficulties for the CommandBox to stay on top.

Howeverd different combinations of the AutoRedraw and the ClipControls properties can influende this behaviour: have a look at for a detailed explanation. _________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]
 
It very much depends which controls you are having problems with. Conceptually a VB form effectively has two drawing layers. One is the surface of the form itself, the other floats just above this.

VB also has two types of controls: lightweight (or non-windowed) controls, and windowed controls.

Lightweight controls are always rendered onto the surface of the form* itself, and windowed controls are always rendered in the floating layer. As a result lightweight controls will always underneath a windowed control in the same form. There is nothing you can do with z-ordering that will change this.

The following standard VB controls are lightweight:
Image
Label
Line
Shape

Regards,
Mike

* I'm playing a little fast and loose with the description here. A lightweight control actually uses the resources of it's parent window. So container controls can contain lightweight controls, but these will always appear behind any windowed control that is also contained in the container control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top