Sliding TabControl and DotNetBar

Jet2020 Jun 12, 2012

  1. Je

    Jet2020 HeXtra Creator XPG Developer
    0/47

    Joined:
    Feb 13, 2012
    Messages:
    146
    Likes Received:
    24
    Trophy Points:
    0
    Console:
    Xbox
    I have got to say as a VB coder this has got to be the nicest thing i have ever seen on vb

    [​IMG]


    I am going to share as i think everyone will love and want to use

    Code:
    Code:
    Class GrayTabControl
        Inherits TabControlDesigner
        Private C1, C2, C3, C4, C5, C6 As Color
        Sub New()
    	    C1 = Color.FromArgb(103, 103, 103) 'Panel Color
    	    C2 = Color.FromArgb(81, 81, 81)
    	    C3 = Color.FromArgb(50, 50, 50)
    	    C4 = Color.FromArgb(120, 120, 120)
    	    C5 = Color.FromArgb(150, 150, 150)
    	    C6 = Color.FromArgb(50, Color.Black)
    	    Alignment = TabAlignment.Left
    	    ItemSize = New Size(44, 136)
    	    SizeMode = TabSizeMode.Fixed
    	    ItemSize = New Size(40, 110)
    	    Font = New Font("Verdana", 8S)
    	    PanelColor = C1
    	    For I As Integer = 0 To TabPages.Count - 1
    		    TabPages(I).BackColor = Color.WhiteSmoke
    	    Next
        End Sub
        Protected Overrides Sub TabPaint(ByVal e As Integer)
    	    Dim T = TabPages(e).Text
    	    Dim R = GetTabRect(e)
    	    Dim Temp = New Rectangle(R.X + 2, R.Y + 5, 110, 35)
    	    If SelectedIndex = e Then
    		    Try : TabPages(e).BackColor = Color.WhiteSmoke : Catch : End Try
    		    G.FillRectangle(ToBrush(C2), Temp)
    		    G.DrawRectangle(ToPen(C3), Temp)
    		    Dim X, Y As Integer
    		    X = Temp.Right
    		    Y = Temp.Y + Temp.Height / 2
    		    Dim P As Point() = {New Point(X, Y - 5), New Point(X, Y + 5), New Point(X - 5, Y)}
    		    G.FillPolygon(Brushes.WhiteSmoke, P)
    	    ElseIf State = MouseState.Over AndAlso Temp.Contains(Coordinates) Then
    		    G.FillRectangle(ToBrush(C4), Temp)
    		    G.DrawRectangle(ToPen(C5), Temp)
    	    End If
    	    G.DrawString(T, Font, Brushes.Black, Center(T, Font, Temp, 0, -1))
    	    G.DrawString(T, Font, Brushes.White, Center(T, Font, Temp))
        End Sub
    End Class
    
    Please Rep + Thanks If you liked :)

    Thanks Jet2020
     
    • Like Like x 2
  2. Bullet

    Bullet XPG Original Founder EST 2000 XPG Administrator XPG Founder
    550/564

    Joined:
    Jul 16, 2009
    Messages:
    20,982
    Likes Received:
    7,955
    Trophy Points:
    550
    Gender:
    Male
    Console:
    Xbox
    Yes i like very much... its :fap:

    Also gives me an idea....
     
  3. Je

    Jet2020 HeXtra Creator XPG Developer
    0/47

    Joined:
    Feb 13, 2012
    Messages:
    146
    Likes Received:
    24
    Trophy Points:
    0
    Console:
    Xbox
    it is a piece of beautiful

    people use this in your programs for professionalism as its amazing :dash2:
     
  4. KillerVidz

    KillerVidz Rocky BANNED
    0/47

    Joined:
    Feb 20, 2012
    Messages:
    3,312
    Likes Received:
    1,250
    Trophy Points:
    0
    Gender:
    Male
    Location:
    XPG-UK
    Console:
    Xbox One
    Nice Share Mate I Might use And Congrats On Becoming Apart Of Dev ;)
     
  5. X9Cinema

    X9Cinema Resident GFX Guru Lifetime Gold
    0/47

    Joined:
    Dec 9, 2011
    Messages:
    2,596
    Likes Received:
    476
    Trophy Points:
    0
    Gender:
    Male
    Location:
    US
    Console:
    Xbox
    Thanks allot, I'm going to try this in a bit.
     
  6. Je

    Jet2020 HeXtra Creator XPG Developer
    0/47

    Joined:
    Feb 13, 2012
    Messages:
    146
    Likes Received:
    24
    Trophy Points:
    0
    Console:
    Xbox
    if you are having trouble with putting images on you a imagelist
     

Share This Page

Close