Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Drawing.Drawing2D
- '------------------
- 'Creator: SoulZeh
- 'Created: 23/11/2011
- 'Credits xZ3ROxPROJ3CTx, oVERT3Xo
- 'I Love him <3
- '------------------
- Class PhenoTheme1
- Inherits ThemeContainer153
- Sub New()
- TransparencyKey = Color.Fuchsia
- SetColor("Border 1", Color.FromArgb(101, 101, 101))
- SetColor("Border 2", Color.FromArgb(110, 110, 110))
- Font = New Font("Calibri", 9)
- BackColor = Color.FromArgb(24, 24, 24)
- SetColor("TopGloss", Color.FromArgb(62, Color.White))
- SetColor("BottomGloss", Color.FromArgb(30, Color.White))
- End Sub
- Protected Overrides Sub ColorHook()
- C1 = GetColor("Border 1")
- C2 = GetColor("Border 2")
- C3 = GetColor("TopGloss")
- C4 = GetColor("BottomGloss")
- End Sub
- Private C1, C2, C3, C4 As Color
- Private RT1 As Rectangle
- Protected Overrides Sub PaintHook()
- DrawGradient(C1, C2, 0, 0, Width, Height)
- RT1 = New Rectangle(11, 25, Width - 22, Height - 35)
- G.FillRectangle(Brushes.White, RT1)
- DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, 13), 90S)
- DrawBorders(Pens.Black)
- DrawCorners(Color.Fuchsia)
- DrawText(Brushes.LimeGreen, HorizontalAlignment.Left, 7, 0)
- G.FillRectangle(New SolidBrush(Color.FromArgb(38, 38, 38)), New Rectangle(11, 25, Width - 22, Height - 35))
- Dim shadowLGB As New LinearGradientBrush(New Rectangle(11, 25, Width - 22, 20), Color.FromArgb(23, 23, 22), Color.FromArgb(38, 38, 38), 90S)
- G.FillRectangle(shadowLGB, New Rectangle(11, 25, Width - 22, 20))
- G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(24, 24, 24))), 11, 26, Width - 11, 26)
- G.DrawRectangle(Pens.Black, New Rectangle(11, 25, Width - 22, Height - 35))
- G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(151, 150, 146))), 1, 1, Width - 2, 1)
- G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(42, 41, 37))), 10, 24, Width - 20, Height - 33)
- DrawCorners(Color.FromArgb(38, 38, 38), New Rectangle(11, 25, Width - 21, Height - 34))
- DrawCorners(Color.FromArgb(55, 55, 55), New Rectangle(9, 23, Width - 21, Height - 34))
- End Sub
- End Class
- Class PhenoSeparator
- Inherits ThemeControl153
- Protected Overrides Sub ColorHook()
- End Sub
- Protected Overrides Sub PaintHook()
- G.FillRectangle(New SolidBrush(Color.FromArgb(38, 38, 38)), ClientRectangle)
- DrawGradient(Color.FromArgb(55, 55, 55), Color.FromArgb(58, 58, 58), New Rectangle(0, Height / 2, Width, 2), 45S)
- End Sub
- End Class
- Class PhenoButton
- Inherits ThemeControl153
- Sub New()
- BackColor = Color.FromArgb(33, 33, 33)
- SetColor("ButtonFillColor", Color.FromArgb(24, 24, 24))
- SetColor("ButtonClickColor", Color.FromArgb(40, 40, 40))
- SetColor("InsetBorderColor", Color.Black)
- SetColor("TopGloss", Color.FromArgb(62, Color.White))
- SetColor("BottomGloss", Color.FromArgb(30, Color.White))
- SetColor("TopInset", Color.FromArgb(45, 45, 45))
- SetColor("BottomInset", Color.FromArgb(95, 70, 70, 70))
- SetColor("BorderColor", Color.Black)
- SetColor("TextColor", Color.Orange)
- End Sub
- Dim C1, C2, C3, C4, C5, C6, C7, C8, C9 As Color
- Protected Overrides Sub ColorHook()
- C1 = GetColor("ButtonFillColor")
- C2 = GetColor("InsetBorderColor")
- C3 = GetColor("TopGloss")
- C4 = GetColor("BottomGloss")
- C5 = GetColor("TopInset")
- C6 = GetColor("BottomInset")
- C7 = GetColor("BorderColor")
- C8 = GetColor("TextColor")
- C9 = GetColor("ButtonClickColor")
- End Sub
- Protected Overrides Sub PaintHook()
- G.Clear(BackColor)
- Select Case State
- Case 0
- G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
- DrawBorders(New Pen(New SolidBrush(C2)), 2)
- DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
- Case 1
- G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
- DrawBorders(New Pen(New SolidBrush(C2)), 2)
- DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
- Case 2
- G.FillRectangle(New SolidBrush(C9), New Rectangle(1, 1, Width - 2, Height - 2))
- DrawBorders(New Pen(New SolidBrush(C2)), 2)
- DrawGradient(C4, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
- End Select
- DrawBorders(New Pen(New SolidBrush(C7)), 1)
- G.DrawLine(New Pen(New SolidBrush(C5)), 0, 0, Width, 0)
- G.DrawLine(New Pen(New SolidBrush(C5)), 0, 0, 0, Height)
- G.DrawLine(New Pen(New SolidBrush(C5)), Width - 1, 0, Width - 1, Height)
- G.DrawLine(New Pen(New SolidBrush(C6)), 0, Height - 1, Width, Height - 1)
- DrawCorners(BackColor)
- DrawCorners(BackColor, New Rectangle(1, 1, Width - 2, Height - 2))
- DrawText(New SolidBrush(C8), HorizontalAlignment.Center, 0, 0)
- End Sub
- End Class
- Class PhenoTabControl
- Inherits TabControl
- Private LightBlack As Color = Color.FromArgb(24, 24, 24)
- Private LighterBlack As Color = Color.FromArgb(24, 24, 24)
- Private DrawGradientBrush, DrawGradientBrush2 As LinearGradientBrush
- Private _ControlBColor As Color
- Public Property TabTextColor() As Color
- Get
- Return _ControlBColor
- End Get
- Set(ByVal v As Color)
- _ControlBColor = v
- Invalidate()
- End Set
- End Property
- Sub New()
- MyBase.New()
- SetStyle(ControlStyles.AllPaintingInWmPaint Or _
- ControlStyles.ResizeRedraw Or _
- ControlStyles.UserPaint Or _
- ControlStyles.DoubleBuffer, True)
- TabTextColor = Color.White
- End Sub
- Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
- MyBase.OnPaint(e)
- Dim r2 As New Rectangle(2, 0, Width - 1, 11)
- Dim r3 As New Rectangle(2, 0, Width - 1, 11)
- e.Graphics.Clear(Color.FromArgb(24, 24, 24))
- Dim ItemBounds As Rectangle
- Dim TextBrush As New SolidBrush(Color.Empty)
- Dim TabBrush As New SolidBrush(Color.Lime)
- e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(24, 24, 24)), New Rectangle(1, 1, Width - 2, Height - 2))
- DrawGradientBrush2 = New LinearGradientBrush(r3, Color.FromArgb(62, Color.White), Color.FromArgb(30, Color.White), 90S)
- e.Graphics.FillRectangle(DrawGradientBrush2, r2)
- For TabItemIndex As Integer = 0 To Me.TabCount - 1
- ItemBounds = Me.GetTabRect(TabItemIndex)
- If CBool(TabItemIndex And 1) Then
- TabBrush.Color = Color.Transparent
- Else
- TabBrush.Color = Color.Transparent
- End If
- e.Graphics.FillRectangle(TabBrush, ItemBounds)
- Dim BorderPen As Pen
- If TabItemIndex = SelectedIndex Then
- BorderPen = New Pen(Color.Transparent, 1)
- Else
- BorderPen = New Pen(Color.Transparent, 1)
- End If
- e.Graphics.DrawRectangle(BorderPen, New Rectangle(ItemBounds.Location.X + 3, ItemBounds.Location.Y + 1, ItemBounds.Width - 8, ItemBounds.Height - 4))
- BorderPen.Dispose()
- Dim sf As New StringFormat
- sf.LineAlignment = StringAlignment.Center
- sf.Alignment = StringAlignment.Center
- If Me.SelectedIndex = TabItemIndex Then
- TextBrush.Color = TabTextColor
- Else
- TextBrush.Color = Color.Gray
- End If
- e.Graphics.DrawString( _
- Me.TabPages(TabItemIndex).Text, _
- Me.Font, TextBrush, _
- RectangleF.op_Implicit(Me.GetTabRect(TabItemIndex)), sf)
- Try
- Me.TabPages(TabItemIndex).BackColor = Color.FromArgb(34, 34, 34)
- Catch
- End Try
- Next
- Try
- For Each tabpg As TabPage In Me.TabPages
- tabpg.BorderStyle = BorderStyle.None
- Next
- Catch
- End Try
- e.Graphics.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(255, Color.Black))), 2, 0, Width - 3, Height - 3)
- e.Graphics.DrawRectangle(New Pen(New SolidBrush(LighterBlack)), New Rectangle(3, 24, Width - 5, Height - 28))
- e.Graphics.DrawLine(New Pen(New SolidBrush(Color.FromArgb(255, Color.Black))), 2, 23, Width - 2, 23)
- e.Graphics.DrawLine(New Pen(New SolidBrush(Color.FromArgb(35, 35, 35))), 0, 0, 1, 1)
- e.Graphics.DrawLine(New Pen(New SolidBrush(Color.FromArgb(70, 70, 70))), 2, Height - 2, Width + 1, Height - 2)
- End Sub
- End Class
- Class PhenoProgressBar
- Inherits ThemeControl153
- Private _Maximum As Integer = 100
- Private OFS As Integer = 0
- Protected Overrides Sub CreateHandle()
- MyBase.CreateHandle()
- Dim Derp As New Timer
- Derp.Interval = 50
- 'Add the animate() sub to the Timer via AddHandler <----- that one
- AddHandler Derp.Tick, AddressOf animate
- Derp.Start()
- End Sub
- Sub animate()
- 'Modify the OFS offset so that it goes up to the control width.
- 'When it reaches control width, set it back to 0
- If OFS <= Width Then : OFS += 1
- Else : OFS = 0
- End If
- Invalidate()
- End Sub
- Public Property Maximum() As Integer
- Get
- Return _Maximum
- End Get
- Set(ByVal value As Integer)
- If value < 1 Then value = 1
- If value < _Value Then _Value = value
- _Maximum = value
- Invalidate()
- End Set
- End Property
- Private _Value As Integer = 50
- Public Property Value() As Integer
- Get
- Return _Value
- End Get
- Set(ByVal value As Integer)
- If value > _Maximum Then value = _Maximum
- _Value = value
- Invalidate()
- End Set
- End Property
- Private C1 As Color 'G.Clear
- Private C2, C3 As Color 'Lime Gradient
- Private P1 As Pen 'DrawRectangle
- Private B1 As Brush 'Gloss
- Sub New()
- Size = New Size(75, 18)
- End Sub
- Protected Overrides Sub ColorHook()
- C1 = Color.FromArgb(28, 28, 28)
- C2 = Color.FromArgb(102, 200, 7)
- C3 = Color.FromArgb(28, 28, 28)
- P1 = Pens.Black
- B1 = New SolidBrush(Color.FromArgb(50, Color.White))
- End Sub
- Protected Overrides Sub PaintHook()
- G.Clear(C1)
- If (_Value > 0) Then
- G.RenderingOrigin = New Point(OFS, 0)
- DrawGradient(C2, C3, 0, 0, CInt((_Value / _Maximum) * Width), Height, 90S)
- Dim T As New HatchBrush(HatchStyle.DarkDownwardDiagonal, Color.FromArgb(65, 3, 35, 58), Color.Empty)
- G.FillRectangle(T, New Rectangle(0, 0, CInt((_Value / _Maximum) * Width), Height))
- End If
- G.FillRectangle(B1, 0, 0, Width, CInt(Height / 2))
- DrawBorders(P1, 0, 0, Width, Height)
- End Sub
- End Class
- Class PhenoCheckBox
- Inherits ThemeControl153
- Private C1 As Color 'G.Clear
- Private C2, C3 As Color 'Lime Gradient
- Private P1 As Pen 'DrawRectangle
- Private B1 As Brush 'Gloss
- Private B2 As Brush 'DrawText
- Private B3 As Brush 'Fill
- Private _Checked As Boolean = False
- Public Property Checked() As Boolean
- Get
- Return _Checked
- End Get
- Set(ByVal checked As Boolean)
- _Checked = checked
- Invalidate()
- End Set
- End Property
- Sub New()
- Size = New Size(136, 20)
- End Sub
- Sub changeChecked() Handles Me.Click
- Select Case _Checked
- Case False
- _Checked = True
- Case True
- _Checked = False
- End Select
- End Sub
- Protected Overrides Sub ColorHook()
- C1 = Color.FromArgb(38, 38, 38)
- C2 = Color.Black
- C3 = Color.Lime
- P1 = Pens.Black
- B1 = New SolidBrush(Color.FromArgb(15, Color.Lime))
- B2 = New SolidBrush(Color.White)
- B3 = New SolidBrush(Color.FromArgb(24, 24, 24))
- End Sub
- Protected Overrides Sub PaintHook()
- G.Clear(C1)
- G.FillRectangle(B3, 0, 0, 15, 15)
- G.DrawRectangle(P1, 0, 0, 15, 15)
- If (_Checked = False) Then
- If (State = MouseState.Over) Then
- DrawGradient(Color.FromArgb(50, 50, 50), Color.FromArgb(15, 15, 15), 2, 2, 11, 11, 90S)
- Else
- DrawGradient(Color.FromArgb(15, 15, 15), Color.FromArgb(50, 50, 50), 2, 2, 11, 11, 90S)
- End If
- Else
- If (State = MouseState.Over) Then
- DrawGradient(C3, C2, 2, 2, 11, 11, 90S)
- Else
- DrawGradient(C2, C3, 2, 2, 11, 11, 90S)
- End If
- End If
- G.FillRectangle(B1, 2, 2, 11, 11)
- G.DrawRectangle(P1, 2, 2, 11, 11)
- DrawText(B2, HorizontalAlignment.Left, 15, 0)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment