[IronPython] Possible problem with DockStyle.Fill

Martin Maly Martin.Maly at microsoft.com
Mon Dec 4 18:12:11 CET 2006


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...

Martin

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Patrick O'Brien
Sent: Saturday, December 02, 2006 3:48 PM
To: users at lists.ironpython.com
Subject: [IronPython] Possible problem with DockStyle.Fill

I've either found a bug or a misunderstanding on my part.  I'd appreciate confirmation or either.  :-)

Running this bit of code the layout of the form appears as expected:

import clr
clr.AddReference('System.Windows.Forms ')
import System.Windows.Forms as SWF

form = SWF.Form()
menu_strip = SWF.MenuStrip()
button = SWF.Button()
button.Dock = SWF.DockStyle.Fill
form.Controls.Add(button)
form.Controls.Add(menu_strip)
SWF.Application.Run(form)


Whereas in the following example the button is cut off by the menu:

import clr
clr.AddReference('System.Windows.Forms')
import System.Windows.Forms as SWF

form = SWF.Form ()
menu_strip = SWF.MenuStrip()
button = SWF.Button()
button.Dock = SWF.DockStyle.Fill
form.Controls.Add(menu_strip)
form.Controls.Add(button)
SWF.Application.Run(form)


The only difference between the two bits of code is the order of the calls to ' form.Controls.Add()'.  Is this expected, or is this a bug?

--
Patrick K. O'Brien
Orbtech       http://www.orbtech.com
Schevo        http://www.schevo.org
Louie         http://www.pylouie.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20061204/d4836da3/attachment.html>


More information about the Ironpython-users mailing list