Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Code today gone tomorrow!
Posted

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

 

   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

Code today gone tomorrow!
Posted

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

.nerd
Posted

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

Code today gone tomorrow!
Posted

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

 

Class fooSection

 

and Class fooContainer

(with a membervariable fooSections as collection)

.nerd

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...