Michael Rosello
Michael Rosello

Reputation: 153

vb.net dock two controls in order

I have a picturebox and a menu strip that are both dock to top.

the menustrip is docked to the upper most part of the form and the picturebox is docked below the menu strip.

How can i make it the other way around. the picture docked to the upper most and the menu strip docked to the picture?

Upvotes: 2

Views: 5130

Answers (4)

Dũng IT
Dũng IT

Reputation: 2999

First, set dock of two control to none then click right mouse on Menustrip select Bring to Front then click right mouse on PictureBox select Bring to Back. Final set dock for Menustrip and PictureBox.

Upvotes: 0

Mariano
Mariano

Reputation: 11

What really worked for me, was to alter de ZOrder from controls. It looks like VB uses that for setting the docking order. Try bringing controls to front and sending them to back to see its effect. Good luck!! Mariano.

Upvotes: 1

Rajaprabhu Aravindasamy
Rajaprabhu Aravindasamy

Reputation: 67207

I think ,You might have docked(top) your controls inside that panel in the following order

  • Menu Strip
  • Picture Box

This is why your controls are not displaying as you have expected.

Just Do like this to achieve your need,

  • Just Reset the dock property for the both controls to none first
  • Set the Dock property as Top for that controls in this order

    1. PictureBox
    2. Menustrip

Upvotes: 0

Velja Radenkovic
Velja Radenkovic

Reputation: 716

Go to your .designer.cs file. Reverse the order in which those 2 components are added to form. If you need help with this task ask in comment.

Upvotes: 1

Related Questions