Link to home
Start Free TrialLog in
Avatar of Alexandre Simões
Alexandre SimõesFlag for Switzerland

asked on

TabControl OwnerDraw and keep the windows theme...

Hi!

How can I ownerdraw the text of the tabpages of a TabControl and still keep the background theme?

I'm using .net framework 2.0, thanks!

Alex :p
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

1) Are you talking about OwnerDrawFixed = true?

2) Or rolling your own TabControl?

Bob
Avatar of Alexandre Simões

ASKER

Hi...
Option 1, OwnerDrawFixed = true.
But the solution is quite the same for both scenarios.

.Net Framework have a new NameSpace called: System.Windows.Forms.VisualStyles
In it you can find the VisualStyleRenderer object, and multiple Elements to use on your controls, either inherited or brand new.

You can find a nice demo by M$ at:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.visualstyles.visualstyleelement.tab.tabitem.aspx


Thanks,
Alex
Cool b-)  *GRIN*

So, now are you asking how to render the TabPage XP theme when using VisualStyleRenderer?

Bob

Nop... done that...
I'm done with this one!
Just didn't knew about that VisualStyles Namespace... It was about time...

I'll ask to delete this one.

Thanks!
Alex
Keep this question.

Bob
ASKER CERTIFIED SOLUTION
Avatar of ee_ai_construct
ee_ai_construct
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial