The TabControl is the bane of my existence
Right now, all I have is hate for the TabControl in .net 1.1. A TabControl consists of several TabPages, on each TabPage you can have an assortment of controls. Suppose you want to disable one of the tabs on your TabControl, you would think to do it like this: TabControl.TabPages(1).Enabled = False.
This “works” I suppose, but all it does is disable every control inside of that TabPage, NOT the tab itself on the control. There aren’t even any good methods to override to create this behavior yourself, they fixed that issue in .net 2.0 with the addition of several events, namely the Selecting event which takes a CancelEventArgs so you can stop the UI action from taking place.
In order to make this work in .net 1.1 you have to subclass the TabControl and the TabPage. You need to draw the freaking TabPage yourself, so that you can make the text gray, like a disabled control is supposed to look. I did just that this afternoon, I’ll post a zip file later for others to use so they hopefully don’t have to go through the pain that I did.
UPDATE: See new post with link to zip file
Ben Reichelt’s Weblog » Better Tab Control for .Net 1.1 said,
Wrote on October 26, 2006 @ 8:05 am
[...] I’ve gotten numerous requests for some source code for the TabControl issue that I mentioned about a month ago, so here is the link: [...]