Geeks With Blogs

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

.NET Hobbyist Programmer Staying Confused in a Busy World
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. Posted on Saturday, March 5, 2005 11:50 PM Programming | Back to top


Comments on this post: WinForms Z-Order

# re: WinForms Z-Order
Requesting Gravatar...
Actually the methods for refine Z-order called BringToFront() and SendToBack() instead of SendToFront() as you mentioned.
Left by Oleg Kleiman on Jan 17, 2006 2:21 AM

# re: WinForms Z-Order
Requesting Gravatar...
Actually the methods for refine Z-order called BringToFront() and SendToBack() instead of SendToFront() as you mentioned.
Left by Oleg Kleiman on Jan 17, 2006 2:22 AM

# re: WinForms Z-Order
Requesting Gravatar...
Thanks for that. I forget this every time i go back to winform hacking
Left by TrickyMick on Apr 11, 2009 10:24 PM

# re: WinForms Z-Order
Requesting Gravatar...
If adding controls manually be sure to call the BringToFront() AFTER the Controls.Add! Spent (luckily only) 10 minutes figuring this one out.
Left by Matt on Jan 28, 2010 7:49 AM

# re: WinForms Z-Order
Requesting Gravatar...
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?
Left by Matt on Jan 28, 2010 8:46 AM

Your comment:
 (will show your gravatar)


Copyright © Mark Treadwell | Powered by: GeeksWithBlogs.net