tags:

views:

661

answers:

2

Hi,

I need to know how could i add a new property to a tab page.

Could you help??

Thanks in advance

Maria

+6  A: 

Derive a class from TabPage and call it MariaTabPage or something. Add the extra property there. After that populate your TabControl with MariaTabPages.

Gerrie Schenck
A: 

Well, one little trick you could use is to put your properties inside your own custom object or structure, and then assign that object to the TabPage's .Tag property, which takes an Object.

Dave Markle
The Tag property was never meant for this, but yes, you can abuse it :)
Gerrie Schenck
Hey, Windows Forms is all about abuse! If you want elegance, use WPF ;-)
Dave Markle
I'm on a personal crusade against the Tag property. It's difficult for others to know what you did with it, and it can easily lead to bugs.
Jon B