a_jam_sandwich Posted February 13, 2003 Posted February 13, 2003 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 Quote Code today gone tomorrow!
Heiko Posted February 13, 2003 Posted February 13, 2003 Why don't you create sth new from scratch then? I always thought it was the tabs (i.e. tabPages) that made the tabControl special. Quote .nerd
a_jam_sandwich Posted February 13, 2003 Author Posted February 13, 2003 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 Quote Code today gone tomorrow!
a_jam_sandwich Posted February 14, 2003 Author Posted February 14, 2003 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 Quote Code today gone tomorrow!
Heiko Posted February 14, 2003 Posted February 14, 2003 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 Quote .nerd
a_jam_sandwich Posted February 14, 2003 Author Posted February 14, 2003 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 Quote Code today gone tomorrow!
Heiko Posted February 14, 2003 Posted February 14, 2003 I did sth distantly similar and I had, indeed, 2 classes: Class fooSection and Class fooContainer (with a membervariable fooSections as collection) Quote .nerd
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.