[IronPython] TabPages - misunderstanding or bug?

Dino Viehland dinov at exchange.microsoft.com
Tue Jun 27 02:05:52 CEST 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: <http://mail.python.org/pipermail/ironpython-users/attachments/20060626/92758c31/attachment.html>


More information about the Ironpython-users mailing list