Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Drawing.Drawing2D
- Imports System.ComponentModel
- Imports System.Runtime.InteropServices
- '------------------
- 'Creator: SoulZeh
- 'Created: 23/11/2011
- 'Credits xZ3ROxPROJ3CTx, oVERT3Xo
- 'I Love him <3
- '------------------
- Class StyleTheme
- Inherits ThemeContainer153
- Sub New()
- TransparencyKey = Color.Fuchsia
- SetColor("Border 1", Color.FromArgb(253, 148, 62))
- SetColor("Border 2", Color.FromArgb(161, 86, 20))
- Font = New Font("Calibri", 9)
- BackColor = Color.FromArgb(77, 201, 255)
- SetColor("TopGloss", Color.FromArgb(62, Color.White))
- SetColor("BottomGloss", Color.FromArgb(30, Color.Blue))
- 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.Brown)
- DrawCorners(Color.Fuchsia)
- DrawText(Brushes.White, HorizontalAlignment.Left, 7, 0)
- G.FillRectangle(New SolidBrush(Color.FromArgb(77, 201, 255)), New Rectangle(11, 25, Width - 22, Height - 35))
- Dim shadowLGB As New LinearGradientBrush(New Rectangle(11, 25, Width - 22, 20), Color.FromArgb(77, 201, 255), Color.FromArgb(77, 201, 255), 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 StyleButton
- Inherits ThemeControl153
- Sub New()
- BackColor = Color.FromArgb(33, 33, 33)
- SetColor("ButtonFillColor", Color.FromArgb(253, 129, 32))
- SetColor("ButtonClickColor", Color.FromArgb(40, 40, 40))
- SetColor("InsetBorderColor", Color.Brown)
- SetColor("TopGloss", Color.FromArgb(62, Color.White))
- SetColor("BottomGloss", Color.FromArgb(30, Color.White))
- SetColor("TopInset", Color.FromArgb(253, 129, 32))
- SetColor("BottomInset", Color.FromArgb(95, 70, 70, 70))
- SetColor("BorderColor", Color.Brown)
- SetColor("TextColor", Color.Black)
- 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 StyleProgressBar
- 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(12, 95, 197)
- C2 = Color.FromArgb(55, 236, 62)
- C3 = Color.FromArgb(137, 244, 109)
- P1 = Pens.Black
- B1 = New SolidBrush(Color.FromArgb(30, 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 StyleComboBox
- Inherits ComboBox
- Sub New()
- MyBase.New()
- SetStyle(ControlStyles.AllPaintingInWmPaint Or _
- ControlStyles.ResizeRedraw Or _
- ControlStyles.UserPaint Or _
- ControlStyles.DoubleBuffer, True)
- DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
- BackColor = Color.FromArgb(45, 45, 45)
- ForeColor = Color.White
- DropDownStyle = ComboBoxStyle.DropDownList
- End Sub
- Private _StartIndex As Integer = 0
- Public Property StartIndex As Integer
- Get
- Return _StartIndex
- End Get
- Set(ByVal value As Integer)
- _StartIndex = value
- Try
- MyBase.SelectedIndex = value
- Catch
- End Try
- Invalidate()
- End Set
- End Property
- Private LightBlack As Color = Color.FromArgb(37, 37, 37)
- Private LighterBlack As Color = Color.FromArgb(60, 60, 60)
- Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
- MyBase.OnPaint(e)
- Dim G As Graphics = e.Graphics
- Dim T As LinearGradientBrush = New LinearGradientBrush(New Rectangle(0, 0, Width, 10), Color.FromArgb(62, Color.White), Color.FromArgb(30, Color.White), 90S)
- Dim DrawCornersBrush As SolidBrush
- DrawCornersBrush = New SolidBrush(Color.FromArgb(37, 37, 37))
- Try
- With G
- G.SmoothingMode = SmoothingMode.HighQuality
- .Clear(Color.FromArgb(37, 37, 37))
- .FillRectangle(T, New Rectangle(0, 0, Width, 9))
- .DrawString(Items(SelectedIndex).ToString, Font, Brushes.White, New Point(3, 3))
- .DrawLine(New Pen(New SolidBrush(Color.FromArgb(37, 37, 37))), 0, 0, 0, 0)
- .DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(0, 0, 0))), New Rectangle(1, 1, Width - 3, Height - 3))
- .DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, Width, 0)
- .DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, 0, Height)
- .DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), Width - 1, 0, Width - 1, Height)
- .DrawLine(New Pen(New SolidBrush(Color.FromArgb(70, 70, 70))), 0, Height - 1, Width, Height - 1)
- DrawTriangle(Color.White, New Point(Width - 15, 8), New Point(Width - 7, 8), New Point(Width - 11, 13), G)
- End With
- Catch
- End Try
- End Sub
- Sub ReplaceItem(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles Me.DrawItem
- e.DrawBackground()
- Try
- If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then
- e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(37, 37, 37)), e.Bounds)
- End If
- Using b As New SolidBrush(e.ForeColor)
- e.Graphics.DrawString(MyBase.GetItemText(MyBase.Items(e.Index)), e.Font, b, e.Bounds)
- End Using
- Catch
- End Try
- e.DrawFocusRectangle()
- End Sub
- Protected Sub DrawTriangle(ByVal Clr As Color, ByVal FirstPoint As Point, ByVal SecondPoint As Point, ByVal ThirdPoint As Point, ByVal G As Graphics)
- Dim points As New List(Of Point)()
- points.Add(FirstPoint)
- points.Add(SecondPoint)
- points.Add(ThirdPoint)
- G.FillPolygon(New SolidBrush(Clr), points.ToArray)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment