[IronPython] TabPages - misunderstanding or bug?

Dino Viehland dinov at exchange.microsoft.com
Mon Jun 26 17:05:52 PDT 2006


It looks like you've set the Text property to be foo/bar/baz, but not Name (which it seems is what this keys off of):

import winforms
import System.Windows.Forms as WF
tc = WF.TabControl()
tp = WF.TabPage('test')
tp.Name = 'test'
tc.TabPages.Add(tp)
tp = WF.TabPage('foo')
tp.Name = 'foo'
tc.TabPages.Add(tp)
tp = WF.TabPage('bar')
tp.Name = 'bar'
tc.TabPages.Add(tp)
tc.TabPages['foo']

prints:

TabPage: {foo}

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of jeff sacksteder
Sent: Monday, June 26, 2006 4:47 PM
To: users at lists.ironpython.com
Subject: [IronPython] TabPages - misunderstanding or bug?

The TabPages attribute of the TabControl class contains a collection of TabPage objects. I was under the impression that individual tabs would be accessable by index or key.  That is apparently not the case.
Is this a bug or a misunderstanding on my part?

>>> for p in tab_book.TabPages:
...     print p
...
TabPage: {foo}
TabPage: {bar}
TabPage: {baz}
>>> print tab_book.TabPages[1]
TabPage: {bar}
>>> print book.TabPages ['bar']
None
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/users-ironpython.com/attachments/20060626/92758c31/attachment.html


More information about the users mailing list