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

Display Imageboxes on a PictureBox 1

Status
Not open for further replies.

Ken01

Programmer
Aug 8, 2014
60
GB
Is it possible to display one or more imageBox(es) on a pictureBox?

I have tried this but the imagebox disappears when dragged on to the picture box.
 
Ok, so, no not really possible.

And the reason is that a form consists of three display layers, not just one. And certain controls and methods arfe restricted to certain layers. Docvumentation on z order, for example, states:

Microsoft Documentation said:
Three graphical layers are associated with forms and containers. The back layer is the drawing space where the results of the graphics methods are displayed. Next is the middle layer where graphical objects and Label controls are displayed. The front layer is where all nongraphical controls like CommandButton, CheckBox, or ListBox are displayed. Anything contained in a layer closer to the front covers anything contained in the layer(s) behind it. ZOrder arranges objects only within the layer where the object is displayed.

Unfortunately the 'ImageBox' - by which I take it you mean the Image control - resides on the bottom layer. The Picturebox lives on the second layer, and this is ALWYAS above the Image control. The workaround is that the PictureBox can act as a container for other controls, so when adding you Image control add it to the Picturebox rather than the form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top