Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TabControl - SelectedTab Question

Status
Not open for further replies.

eb24

Programmer
Dec 17, 2003
240
US
I have a TabControl in place and would like to have the selectedt tab to have bold text and the other tabs to be grayed out or not be so prevalent. I was trying something like this:
Code:
private void tabControl1_Selected(object sender, TabControlEventArgs e)
        {
            if (this.tabControl1.SelectedTab = tab1)
            {
                tabControl1.Font.Bold = true;
            }
 
that's not the way a tab control works.

one of the most painful parts of learning to program in windows is accepting that controls should look and work exactly as microsoft program them.

experienced users will be bemused by your changes, and wonder why you spent so much effort for so little reward.

inexperienced users will be confused by the fact that the rest of windows doesn't work the way your app does.

put away your desire, it's really not worth the effort.



mr s. <;)

 
Wow mr. s, that was dream shattering.


You can in fact turn the tabcontrol so that the drawmode is "Owner Draw" and then draw your own tab on the tab paint event. At this point you could draw your string in a bold text.

e.Graphics.DrawString()



The idea of being stuck with the way MS does things bothers me. They have been "leading the way" with UI design up until a few years ago. Now they are trying to copy the mac/linux world. Even IE7 is a rip-off of FireFox and Opera. So eb24 - rock on. Break the boundaries of the MS world and make that tab bold :)

P.S. Opera Rocks. Long live Ubuntu!
 
ok, let me qualify that.

ask yourself why you want the change.

if the answer is "for science" and you really want to learn how to use Paint() effectively despite the fifty ways it can screw up, then fine.

if the answer is "for posterity" and you want to re-engineer a control and take on its maintenance whenever microsoft decide to change the base object, then knock yourself out.

if tyhe answer is "for obscurity" and you want to create non-standard controls which will cease to be intuitive because they don't work in a way that the user is familiar with, go ahead.

if you want to make the change only because the controls as it is irritates or annoys you, then take a step back and change your desires and leave well alone. it really will save you a great deal of heartache.


mr s. <;)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top