.NET Hobbyist Programmer

Staying Confused in a Busy World
posts - 271, comments - 284, trackbacks - 660

My Links

News

Neat Stuff Read all my hurricane entries While you are here, visit the Geeks With Blogs main feed
Advertising
Links Status of the Navy
Channel 9

Tag Cloud

Article Categories

Archives

Post Categories

WinForms Z-Order

This is a reminder to myself in the future.  When you need to adjust the z-order of controls on a WinForm, you can use the controls' SendToFront and SendToBack methods.  A better solution is to go to the control's container.  There in the container's Controls property is the SetChildIndex method that can then independently set the z-order of its contained controls.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Saturday, March 05, 2005 11:50 PM | Filed Under [ Programming ]

Feedback

Gravatar

# re: WinForms Z-Order

Actually the methods for refine Z-order called BringToFront() and SendToBack() instead of SendToFront() as you mentioned.
1/17/2006 2:21 AM | Oleg Kleiman
Gravatar

# re: WinForms Z-Order

Actually the methods for refine Z-order called BringToFront() and SendToBack() instead of SendToFront() as you mentioned.
1/17/2006 2:22 AM | Oleg Kleiman
Gravatar

# re: WinForms Z-Order

Thanks for that. I forget this every time i go back to winform hacking
4/11/2009 10:24 PM | TrickyMick
Gravatar

# re: WinForms Z-Order

If adding controls manually be sure to call the BringToFront() AFTER the Controls.Add! Spent (luckily only) 10 minutes figuring this one out.
1/28/2010 7:49 AM | Matt
Gravatar

# re: WinForms Z-Order

I actually have another question. I have a Panel with a opaque background image and a mouse event for the Panel handles adding a Panel with a background image that is partially transparent. Each time I call the Controls.Add I call the BringToFront() and then the Panel is displayed. I would expect each new Panel to sit on top of the last, but they're actually showing up behind the first new Panel. Any ideas there?
1/28/2010 8:46 AM | Matt
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: