Results 1 to 5 of 5

Thread: [RESOLVED] Dock panel above menustrip

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2021
    Posts
    3

    Resolved [RESOLVED] Dock panel above menustrip

    Hello all,

    I want to create a borderless form (FormBorderStyle - None) and add a Panel (title bar)and a MenuStrip.
    But I want to have the Panel above the MenuStrip.
    Reason is that I want to be able to change the Title bar (Panel in this case) background color of image.

    Every time I Dock both to Top, the MenuStrip will be the top one.
    It there a way to have first the Panel and below the Panel the MenuStrip?

    BR
    ARengineering

  2. #2
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    Re: Dock panel above menustrip

    Why not place the menustrip in another panel, then stack the panels in the order you want?
    "Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2021
    Posts
    3

    Re: Dock panel above menustrip

    Why are some things so easy that you look over it ;-)

    Thanks!

    Issue Resolved

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: [RESOLVED] Dock panel above menustrip

    The order in which controls dock to edges is determined by the z-order. That is the same order that determines which control appears in front and which behind when they overlap. Controls that would appear further to the back in the z-order when overlapped will appear closer to the edge when docked. The solution to your problem is to simply change the z-order.

    If you right-click a control then you can select Bring To Front or Send To Back to push it to either end of the z-order. If you right-click your Panel and select Send To Back then it will dock above the MenuStrip against the top edge of the form. If you would like fine-grained control of the z-order then open the Document Outline window from the View menu.

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2021
    Posts
    3

    Re: [RESOLVED] Dock panel above menustrip

    Works like a charm! Great solution and explanation!
    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width