[Python.NET] Is there a chance to imprive Python for .net to let "System.Windows.Forms.Form().Controls" be indexable?

Barton barton at BCDesignsWell.com
Fri Sep 2 08:29:21 CEST 2011


Yes, this is well worth looking into. I may be able to get to this this 
weekend.
Thank you.

On 8/31/2011 10:30 PM, 刘振海 wrote:
> Hi,
>
> here  is the code:
>
> import clr
> clr.AddReference("System.Windows.Forms")
> from System.Windows.Forms import Form,Application,Button
> form=Form()
> form.Controls.Add(Button())
> print form.Controls[0] #this code didnt work with an error say "not 
> indexable object"
>
> but this worked in ironpython,it seems in ironpython it treats the 
> "form.Controls" as an list like object
> I can only get the form.Controls value use the 
> "form.Controls.get_Item(0)" in the python for .net
> So is there a chance to imprive Python for .net to have 
> that characteristic?
>
> thanks
>
>
>
> _________________________________________________
> Python.NET mailing list - PythonDotNet at python.org
> http://mail.python.org/mailman/listinfo/pythondotnet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20110901/aa5395fd/attachment.html>


More information about the PythonDotNet mailing list