2

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

Could you help??

Thanks in advance

Maria

2 Answers 2

6

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

2

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.

3
  • The Tag property was never meant for this, but yes, you can abuse it :) Feb 3, 2009 at 12:36
  • Hey, Windows Forms is all about abuse! If you want elegance, use WPF ;-) Feb 3, 2009 at 14:17
  • 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
    Feb 3, 2009 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.