TAB CONTROL look

a_jam_sandwich

Junior Contributor
Joined
Dec 10, 2002
Messages
367
Location
Uk
Right im trying to create my own control that inherits the Tab Control. Basically I think the one that comes with .NET is naff.

I don't want to see the tabs and change the overall style of how it looks.

How do I do about this?

As from what i can see and im probley wrong overriding the OnPaint doesn't change the look at all, from what I can see the Tab Control is just a container and the pages are the drawn part.

I have no idea what I need to change mess or brake to get this working any suggestions would be greatly appreciated

Andy
 
well ive just been having a mess around and ...

Visual Basic:
    Protected Overrides Sub onPaint(ByVal pevent As System.Windows.Forms.PaintEventArgs)
        Dim GradiantBrush As Brush
        GradiantBrush = New Drawing2D.LinearGradientBrush(New Point(0, 0), New Point(Me.Width, Me.Height), Color.White, Color.LightGray)
        pevent.Graphics.FillRectangle(GradiantBrush, ClientRectangle)
        ControlPaint.DrawBorder3D(pevent.Graphics, ClientRectangle, Border3DStyle.Etched)
    End Sub

In the Tabpage class OnPaint and makes a nice gradiant but only on the Tabpage, buttons still exist etc so I have no idea what to add modify etc.

Anyone know of a tutorial for creating a custom Tab Control?

Andy
 
still trying to figure this out would it be better to create a new control based on collection on my Tab pages ?

if so how...

Please help this is now bugging me

Cheers

Andy
 
Hard to tell, because I haven't yet got a clue, what excatly you want to change.

From my personal experience, from my pathetic, miniscule personal experience, I'd say: Build a new control. (And keep the fingers crossed, that there is a standard Designer that supports the collection).

H
 
Im wondering do i have to create 3 controls i.e

1. New tabpage with my new look
2. The collection class to hold the tabpages class Im creating
3. The Tab control that uses the collection

If so how ?

Andy
 
I did sth distantly similar and I had, indeed, 2 classes:

Class fooSection

and Class fooContainer
(with a membervariable fooSections as collection)
 
Back
Top