This is related to Z-Order in Winforms. You can take a look at MSDN document, 
or I found http://geekswithblogs.net/mtreadwell/archive/2005/03/05/25397.aspx 
online.

Adding "button.BringToFront" works:

form.Controls.Add(menu_strip)
form.Controls.Add(button)
button.BringToFront()   # add this
SWF.Application.Run(form)


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick O'Brien
Sent: Monday, December 04, 2006 9:43 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Possible problem with DockStyle.Fill

On 12/4/06, Martin Maly <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote:

I suspect that the same code written in VB/C# would behave the same way. This 
is most likely behavior of Windows Forms. Not being a winforms expert, I can't 
tell for sure whether this is correct behavior or a bug in Winforms...
I created a similar C# app and can confirm that it behaves the same way.  If 
this is not a bug, it is extremely counterintuitive behavior.  I could see the 
button getting truncated by the menu if I added the button with Fill first, 
then added the menu.  But that is the order that works fine.  The one that 
truncates is when you add the menu, then add the button.  Whatever it is, it 
certainly isn't nice.  :-(

--
Patrick K. O'Brien
Orbtech       http://www.orbtech.com
Schevo        http://www.schevo.org
Louie         http://www.pylouie.org
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to