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
LVL 31
Alexandre SimõesManager / Technology SpecialistAsked:
Who is Participating?
 
ee_ai_constructCommented:
Closed, 500 points refunded.
ee_ai_construct
Community Support Moderator
replacement part #xm34
0
 
Bob LearnedCommented:
1) Are you talking about OwnerDrawFixed = true?

2) Or rolling your own TabControl?

Bob
0
 
Alexandre SimõesManager / Technology SpecialistAuthor Commented:
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
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
Bob LearnedCommented:
Cool b-)  *GRIN*

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

Bob
0
 
Alexandre SimõesManager / Technology SpecialistAuthor Commented:

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
0
 
Bob LearnedCommented:
Keep this question.

Bob
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.