Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 5th, 2012  |  syntax: None  |  size: 18.49 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Imports System.Drawing.Drawing2D
  2. Imports System.ComponentModel
  3. Imports System.Runtime.InteropServices
  4. 'Author:   TheDarky
  5. 'Credits:  Aeonhack [Themebase and Tutorials :)]
  6. 'Version:  0.1
  7. MustInherit Class Theme
  8.     Inherits ContainerControl
  9.  
  10. #Region " Initialization "
  11.  
  12.     Protected G As Graphics
  13.     Sub New()
  14.         SetStyle(DirectCast(139270, ControlStyles), True)
  15.     End Sub
  16.  
  17.     Private ParentIsForm As Boolean
  18.     Protected Overrides Sub OnHandleCreated(ByVal e As EventArgs)
  19.         Dock = DockStyle.Fill
  20.         ParentIsForm = TypeOf Parent Is Form
  21.         If ParentIsForm Then
  22.             If Not _TransparencyKey = Color.Empty Then ParentForm.TransparencyKey = _TransparencyKey
  23.             ParentForm.FormBorderStyle = FormBorderStyle.None
  24.         End If
  25.         MyBase.OnHandleCreated(e)
  26.     End Sub
  27.  
  28.     Overrides Property Text() As String
  29.         Get
  30.             Return MyBase.Text
  31.         End Get
  32.         Set(ByVal v As String)
  33.             MyBase.Text = v
  34.             Invalidate()
  35.         End Set
  36.     End Property
  37. #End Region
  38.  
  39. #Region " Sizing and Movement "
  40.  
  41.     Private _Resizable As Boolean = True
  42.     Property Resizable() As Boolean
  43.         Get
  44.             Return _Resizable
  45.         End Get
  46.         Set(ByVal value As Boolean)
  47.             _Resizable = value
  48.         End Set
  49.     End Property
  50.  
  51.     Private _MoveHeight As Integer = 24
  52.     Property MoveHeight() As Integer
  53.         Get
  54.             Return _MoveHeight
  55.         End Get
  56.         Set(ByVal v As Integer)
  57.             _MoveHeight = v
  58.             Header = New Rectangle(7, 7, Width - 14, _MoveHeight - 7)
  59.         End Set
  60.     End Property
  61.  
  62.     Private Flag As IntPtr
  63.     Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  64.         If Not e.Button = MouseButtons.Left Then Return
  65.         If ParentIsForm Then If ParentForm.WindowState = FormWindowState.Maximized Then Return
  66.  
  67.         If Header.Contains(e.Location) Then
  68.             Flag = New IntPtr(2)
  69.         ElseIf Current.Position = 0 Or Not _Resizable Then
  70.             Return
  71.         Else
  72.             Flag = New IntPtr(Current.Position)
  73.         End If
  74.  
  75.         Capture = False
  76.         DefWndProc(Message.Create(Parent.Handle, 161, Flag, Nothing))
  77.  
  78.         MyBase.OnMouseDown(e)
  79.     End Sub
  80.  
  81.     Private Structure Pointer
  82.         ReadOnly Cursor As Cursor, Position As Byte
  83.         Sub New(ByVal c As Cursor, ByVal p As Byte)
  84.             Cursor = c
  85.             Position = p
  86.         End Sub
  87.     End Structure
  88.  
  89.     Private F1, F2, F3, F4 As Boolean, PTC As Point
  90.     Private Function GetPointer() As Pointer
  91.         PTC = PointToClient(MousePosition)
  92.         F1 = PTC.X < 7
  93.         F2 = PTC.X > Width - 7
  94.         F3 = PTC.Y < 7
  95.         F4 = PTC.Y > Height - 7
  96.  
  97.         If F1 And F3 Then Return New Pointer(Cursors.SizeNWSE, 13)
  98.         If F1 And F4 Then Return New Pointer(Cursors.SizeNESW, 16)
  99.         If F2 And F3 Then Return New Pointer(Cursors.SizeNESW, 14)
  100.         If F2 And F4 Then Return New Pointer(Cursors.SizeNWSE, 17)
  101.         If F1 Then Return New Pointer(Cursors.SizeWE, 10)
  102.         If F2 Then Return New Pointer(Cursors.SizeWE, 11)
  103.         If F3 Then Return New Pointer(Cursors.SizeNS, 12)
  104.         If F4 Then Return New Pointer(Cursors.SizeNS, 15)
  105.         Return New Pointer(Cursors.Default, 0)
  106.     End Function
  107.  
  108.     Private Current, Pending As Pointer
  109.     Private Sub SetCurrent()
  110.         Pending = GetPointer()
  111.         If Current.Position = Pending.Position Then Return
  112.         Current = GetPointer()
  113.         Cursor = Current.Cursor
  114.     End Sub
  115.  
  116.     Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
  117.         If _Resizable Then SetCurrent()
  118.         MyBase.OnMouseMove(e)
  119.     End Sub
  120.  
  121.     Protected Header As Rectangle
  122.     Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  123.         If Width = 0 OrElse Height = 0 Then Return
  124.         Header = New Rectangle(7, 7, Width - 14, _MoveHeight - 7)
  125.         Invalidate()
  126.         MyBase.OnSizeChanged(e)
  127.     End Sub
  128.  
  129. #End Region
  130.  
  131. #Region " Convienence "
  132.  
  133.     MustOverride Sub PaintHook()
  134.     Protected NotOverridable Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  135.         If Width = 0 OrElse Height = 0 Then Return
  136.         G = e.Graphics
  137.         PaintHook()
  138.     End Sub
  139.  
  140.     Private _TransparencyKey As Color
  141.     Property TransparencyKey() As Color
  142.         Get
  143.             Return _TransparencyKey
  144.         End Get
  145.         Set(ByVal v As Color)
  146.             _TransparencyKey = v
  147.             Invalidate()
  148.         End Set
  149.     End Property
  150.  
  151.     Private _Image As Image
  152.     Property Image() As Image
  153.         Get
  154.             Return _Image
  155.         End Get
  156.         Set(ByVal value As Image)
  157.             _Image = value
  158.             Invalidate()
  159.         End Set
  160.     End Property
  161.     ReadOnly Property ImageWidth() As Integer
  162.         Get
  163.             If _Image Is Nothing Then Return 0
  164.             Return _Image.Width
  165.         End Get
  166.     End Property
  167.  
  168.     Private _Size As Size
  169.     Private _Rectangle As Rectangle
  170.     Private _Gradient As LinearGradientBrush
  171.     Private _Brush As SolidBrush
  172.  
  173.     Protected Sub DrawCorners(ByVal c As Color, ByVal rect As Rectangle)
  174.         _Brush = New SolidBrush(c)
  175.         G.FillRectangle(_Brush, rect.X, rect.Y, 1, 1)
  176.         G.FillRectangle(_Brush, rect.X + (rect.Width - 1), rect.Y, 1, 1)
  177.         G.FillRectangle(_Brush, rect.X, rect.Y + (rect.Height - 1), 1, 1)
  178.         G.FillRectangle(_Brush, rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), 1, 1)
  179.     End Sub
  180.  
  181.     Protected Sub DrawBorders(ByVal p1 As Pen, ByVal p2 As Pen, ByVal rect As Rectangle)
  182.         G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1)
  183.         G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3)
  184.     End Sub
  185.  
  186.     Protected Sub DrawText(ByVal a As HorizontalAlignment, ByVal c As Color, ByVal x As Integer)
  187.         DrawText(a, c, x, 0)
  188.     End Sub
  189.     Protected Sub DrawText(ByVal a As HorizontalAlignment, ByVal c As Color, ByVal x As Integer, ByVal y As Integer)
  190.         If String.IsNullOrEmpty(Text) Then Return
  191.         _Size = G.MeasureString(Text, Font).ToSize
  192.         _Brush = New SolidBrush(c)
  193.  
  194.         Select Case a
  195.             Case HorizontalAlignment.Left
  196.                 G.DrawString(Text, Font, _Brush, x, _MoveHeight \ 2 - _Size.Height \ 2 + y)
  197.             Case HorizontalAlignment.Right
  198.                 G.DrawString(Text, Font, _Brush, Width - _Size.Width - x, _MoveHeight \ 2 - _Size.Height \ 2 + y)
  199.             Case HorizontalAlignment.Center
  200.                 G.DrawString(Text, Font, _Brush, Width \ 2 - _Size.Width \ 2 + x, _MoveHeight \ 2 - _Size.Height \ 2 + y)
  201.         End Select
  202.     End Sub
  203.  
  204.     Protected Sub DrawIcon(ByVal a As HorizontalAlignment, ByVal x As Integer)
  205.         DrawIcon(a, x, 0)
  206.     End Sub
  207.     Protected Sub DrawIcon(ByVal a As HorizontalAlignment, ByVal x As Integer, ByVal y As Integer)
  208.         If _Image Is Nothing Then Return
  209.         Select Case a
  210.             Case HorizontalAlignment.Left
  211.                 G.DrawImage(_Image, x, _MoveHeight \ 2 - _Image.Height \ 2 + y)
  212.             Case HorizontalAlignment.Right
  213.                 G.DrawImage(_Image, Width - _Image.Width - x, _MoveHeight \ 2 - _Image.Height \ 2 + y)
  214.             Case HorizontalAlignment.Center
  215.                 G.DrawImage(_Image, Width \ 2 - _Image.Width \ 2, _MoveHeight \ 2 - _Image.Height \ 2)
  216.         End Select
  217.     End Sub
  218.  
  219.     Protected Sub DrawGradient(ByVal c1 As Color, ByVal c2 As Color, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal angle As Single)
  220.         _Rectangle = New Rectangle(x, y, width, height)
  221.         _Gradient = New LinearGradientBrush(_Rectangle, c1, c2, angle)
  222.         G.FillRectangle(_Gradient, _Rectangle)
  223.     End Sub
  224.  
  225. #End Region
  226.  
  227.     Private Sub InitializeComponent()
  228.         Me.SuspendLayout()
  229.         Me.ResumeLayout(False)
  230.  
  231.     End Sub
  232.  
  233.     Private Sub ETheme1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  234.  
  235.     End Sub
  236. End Class
  237. MustInherit Class ThemeControl
  238.     Inherits Control
  239.  
  240. #Region " Initialization "
  241.  
  242.     Protected G As Graphics, B As Bitmap
  243.     Sub New()
  244.         SetStyle(DirectCast(139270, ControlStyles), True)
  245.         B = New Bitmap(1, 1)
  246.         G = Graphics.FromImage(B)
  247.     End Sub
  248.  
  249.     Sub AllowTransparent()
  250.         SetStyle(ControlStyles.Opaque, False)
  251.         SetStyle(ControlStyles.SupportsTransparentBackColor, True)
  252.     End Sub
  253.  
  254.     Overrides Property Text() As String
  255.         Get
  256.             Return MyBase.Text
  257.         End Get
  258.         Set(ByVal v As String)
  259.             MyBase.Text = v
  260.             Invalidate()
  261.         End Set
  262.     End Property
  263. #End Region
  264.  
  265. #Region " Mouse Handling "
  266.  
  267.     Protected Enum State As Byte
  268.         MouseNone = 0
  269.         MouseOver = 1
  270.         MouseDown = 2
  271.     End Enum
  272.  
  273.     Protected MouseState As State
  274.     Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs)
  275.         ChangeMouseState(State.MouseNone)
  276.         MyBase.OnMouseLeave(e)
  277.     End Sub
  278.     Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs)
  279.         ChangeMouseState(State.MouseOver)
  280.         MyBase.OnMouseEnter(e)
  281.     End Sub
  282.     Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs)
  283.         ChangeMouseState(State.MouseOver)
  284.         MyBase.OnMouseUp(e)
  285.     End Sub
  286.     Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  287.         If e.Button = MouseButtons.Left Then ChangeMouseState(State.MouseDown)
  288.         MyBase.OnMouseDown(e)
  289.     End Sub
  290.  
  291.     Private Sub ChangeMouseState(ByVal e As State)
  292.         MouseState = e
  293.         Invalidate()
  294.     End Sub
  295.  
  296. #End Region
  297.  
  298. #Region " Convienence "
  299.  
  300.     MustOverride Sub PaintHook()
  301.     Protected NotOverridable Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  302.         If Width = 0 OrElse Height = 0 Then Return
  303.         PaintHook()
  304.         e.Graphics.DrawImage(B, 0, 0)
  305.     End Sub
  306.  
  307.     Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  308.         If Not Width = 0 AndAlso Not Height = 0 Then
  309.             B = New Bitmap(Width, Height)
  310.             G = Graphics.FromImage(B)
  311.             Invalidate()
  312.         End If
  313.         MyBase.OnSizeChanged(e)
  314.     End Sub
  315.  
  316.     Private _NoRounding As Boolean
  317.     Property NoRounding() As Boolean
  318.         Get
  319.             Return _NoRounding
  320.         End Get
  321.         Set(ByVal v As Boolean)
  322.             _NoRounding = v
  323.             Invalidate()
  324.         End Set
  325.     End Property
  326.  
  327.     Private _Image As Image
  328.     Property Image() As Image
  329.         Get
  330.             Return _Image
  331.         End Get
  332.         Set(ByVal value As Image)
  333.             _Image = value
  334.             Invalidate()
  335.         End Set
  336.     End Property
  337.     ReadOnly Property ImageWidth() As Integer
  338.         Get
  339.             If _Image Is Nothing Then Return 0
  340.             Return _Image.Width
  341.         End Get
  342.     End Property
  343.     ReadOnly Property ImageTop() As Integer
  344.         Get
  345.             If _Image Is Nothing Then Return 0
  346.             Return Height \ 2 - _Image.Height \ 2
  347.         End Get
  348.     End Property
  349.  
  350.     Private _Size As Size
  351.     Private _Rectangle As Rectangle
  352.     Private _Gradient As LinearGradientBrush
  353.     Private _Brush As SolidBrush
  354.  
  355.     Protected Sub DrawCorners(ByVal c As Color, ByVal rect As Rectangle)
  356.         If _NoRounding Then Return
  357.  
  358.         B.SetPixel(rect.X, rect.Y, c)
  359.         B.SetPixel(rect.X + (rect.Width - 1), rect.Y, c)
  360.         B.SetPixel(rect.X, rect.Y + (rect.Height - 1), c)
  361.         B.SetPixel(rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), c)
  362.     End Sub
  363.  
  364.     Protected Sub DrawBorders(ByVal p1 As Pen, ByVal p2 As Pen, ByVal rect As Rectangle)
  365.         G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1)
  366.         G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3)
  367.     End Sub
  368.  
  369.     Protected Sub DrawText(ByVal a As HorizontalAlignment, ByVal c As Color, ByVal x As Integer)
  370.         DrawText(a, c, x, 0)
  371.     End Sub
  372.     Protected Sub DrawText(ByVal a As HorizontalAlignment, ByVal c As Color, ByVal x As Integer, ByVal y As Integer)
  373.         If String.IsNullOrEmpty(Text) Then Return
  374.         _Size = G.MeasureString(Text, Font).ToSize
  375.         _Brush = New SolidBrush(c)
  376.  
  377.         Select Case a
  378.             Case HorizontalAlignment.Left
  379.                 G.DrawString(Text, Font, _Brush, x, Height \ 2 - _Size.Height \ 2 + y)
  380.             Case HorizontalAlignment.Right
  381.                 G.DrawString(Text, Font, _Brush, Width - _Size.Width - x, Height \ 2 - _Size.Height \ 2 + y)
  382.             Case HorizontalAlignment.Center
  383.                 G.DrawString(Text, Font, _Brush, Width \ 2 - _Size.Width \ 2 + x, Height \ 2 - _Size.Height \ 2 + y)
  384.         End Select
  385.     End Sub
  386.  
  387.     Protected Sub DrawIcon(ByVal a As HorizontalAlignment, ByVal x As Integer)
  388.         DrawIcon(a, x, 0)
  389.     End Sub
  390.     Protected Sub DrawIcon(ByVal a As HorizontalAlignment, ByVal x As Integer, ByVal y As Integer)
  391.         If _Image Is Nothing Then Return
  392.         Select Case a
  393.             Case HorizontalAlignment.Left
  394.                 G.DrawImage(_Image, x, Height \ 2 - _Image.Height \ 2 + y)
  395.             Case HorizontalAlignment.Right
  396.                 G.DrawImage(_Image, Width - _Image.Width - x, Height \ 2 - _Image.Height \ 2 + y)
  397.             Case HorizontalAlignment.Center
  398.                 G.DrawImage(_Image, Width \ 2 - _Image.Width \ 2, Height \ 2 - _Image.Height \ 2)
  399.         End Select
  400.     End Sub
  401.  
  402.     Protected Sub DrawGradient(ByVal c1 As Color, ByVal c2 As Color, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal angle As Single)
  403.         _Rectangle = New Rectangle(x, y, width, height)
  404.         _Gradient = New LinearGradientBrush(_Rectangle, c1, c2, angle)
  405.         G.FillRectangle(_Gradient, _Rectangle)
  406.     End Sub
  407. #End Region
  408.  
  409. End Class
  410. MustInherit Class ThemeContainerControl
  411.     Inherits ContainerControl
  412.  
  413. #Region " Initialization "
  414.  
  415.     Protected G As Graphics, B As Bitmap
  416.     Sub New()
  417.         SetStyle(DirectCast(139270, ControlStyles), True)
  418.         B = New Bitmap(1, 1)
  419.         G = Graphics.FromImage(B)
  420.     End Sub
  421.  
  422.     Sub AllowTransparent()
  423.         SetStyle(ControlStyles.Opaque, False)
  424.         SetStyle(ControlStyles.SupportsTransparentBackColor, True)
  425.     End Sub
  426.  
  427. #End Region
  428. #Region " Convienence "
  429.  
  430.     MustOverride Sub PaintHook()
  431.     Protected NotOverridable Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  432.         If Width = 0 OrElse Height = 0 Then Return
  433.         PaintHook()
  434.         e.Graphics.DrawImage(B, 0, 0)
  435.     End Sub
  436.  
  437.     Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  438.         If Not Width = 0 AndAlso Not Height = 0 Then
  439.             B = New Bitmap(Width, Height)
  440.             G = Graphics.FromImage(B)
  441.             Invalidate()
  442.         End If
  443.         MyBase.OnSizeChanged(e)
  444.     End Sub
  445.  
  446.     Private _NoRounding As Boolean
  447.     Property NoRounding() As Boolean
  448.         Get
  449.             Return _NoRounding
  450.         End Get
  451.         Set(ByVal v As Boolean)
  452.             _NoRounding = v
  453.             Invalidate()
  454.         End Set
  455.     End Property
  456.  
  457.     Private _Rectangle As Rectangle
  458.     Private _Gradient As LinearGradientBrush
  459.  
  460.     Protected Sub DrawCorners(ByVal c As Color, ByVal rect As Rectangle)
  461.         If _NoRounding Then Return
  462.         B.SetPixel(rect.X, rect.Y, c)
  463.         B.SetPixel(rect.X + (rect.Width - 1), rect.Y, c)
  464.         B.SetPixel(rect.X, rect.Y + (rect.Height - 1), c)
  465.         B.SetPixel(rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), c)
  466.     End Sub
  467.  
  468.     Protected Sub DrawBorders(ByVal p1 As Pen, ByVal p2 As Pen, ByVal rect As Rectangle)
  469.         G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1)
  470.         G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3)
  471.     End Sub
  472.  
  473.     Protected Sub DrawGradient(ByVal c1 As Color, ByVal c2 As Color, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal angle As Single)
  474.         _Rectangle = New Rectangle(x, y, width, height)
  475.         _Gradient = New LinearGradientBrush(_Rectangle, c1, c2, angle)
  476.         G.FillRectangle(_Gradient, _Rectangle)
  477.     End Sub
  478. #End Region
  479.  
  480. End Class
  481.  
  482. Class eTheme
  483.     Inherits Theme
  484.     Sub New()
  485.         BackColor = Color.FromArgb(53, 53, 53)
  486.         MoveHeight = 30
  487.     End Sub
  488.     Overrides Sub PaintHook()
  489.  
  490.         G.Clear(Color.FromArgb(53, 53, 53))
  491.         DrawGradient(Color.FromArgb(50, 50, 50), Color.FromArgb(50, 50, 50), 0, 1, Width, 14, 90S)
  492.         DrawGradient(Color.FromArgb(29, 29, 29), Color.FromArgb(29, 29, 29), 2, 16, Width, 14, 90S)
  493.         G.DrawLine(Pens.Black, 0, 30, Width, 30)
  494.         DrawBorders(Pens.Gray, Pens.Black, ClientRectangle)
  495.         DrawText(HorizontalAlignment.Center, Color.Gray, 0)
  496.  
  497.     End Sub
  498. End Class
  499.  
  500. Class eButton
  501.     Inherits ThemeControl
  502.     Overrides Sub PaintHook()
  503.         Select Case MouseState
  504.             Case State.MouseNone
  505.                 G.Clear(Color.FromArgb(49, 49, 49))
  506.                 DrawGradient(Color.FromArgb(50, 50, 50), Color.FromArgb(40, 40, 40), ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height, 90S)
  507.             Case State.MouseDown
  508.                 G.Clear(Color.FromArgb(49, 49, 49))
  509.                 DrawGradient(Color.FromArgb(40, 40, 40), Color.FromArgb(50, 50, 50), ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height, 90S)
  510.             Case State.MouseOver
  511.                 G.Clear(Color.FromArgb(49, 49, 49))
  512.                 DrawGradient(Color.FromArgb(60, 60, 60), Color.FromArgb(50, 50, 50), ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height, 90S)
  513.         End Select
  514.         DrawText(HorizontalAlignment.Center, Color.Gray, 0)
  515.         DrawBorders(Pens.Black, Pens.DimGray, ClientRectangle)
  516.         DrawCorners(Color.FromArgb(53, 53, 53), ClientRectangle)
  517.  
  518.     End Sub
  519. End Class
  520.  
  521. Class eGroupBox
  522.     Inherits ThemeContainerControl
  523.     Sub New()
  524.         AllowTransparent()
  525.     End Sub
  526.     Overrides Sub PaintHook()
  527.         G.Clear(Color.FromArgb(45, 45, 45))
  528.         DrawBorders(New Pen(Color.FromArgb(25, Color.White)), New Pen(Color.FromArgb(90, Color.Black)), ClientRectangle)
  529.         DrawCorners(BackColor, ClientRectangle)
  530.     End Sub
  531. End Class
  532.  
  533. Class eLabel
  534.     Inherits ThemeControl
  535.     Overrides Sub PaintHook()
  536.         G.Clear(BackColor)
  537.         DrawText(HorizontalAlignment.Center, Color.Gray, 0)
  538.     End Sub
  539. End Class
  540.  
  541. Class eSeperator
  542.     Inherits ThemeControl
  543.     Overrides Sub PaintHook()
  544.         G.Clear(BackColor)
  545.         G.DrawLine(Pens.Gray, 0, CInt(ClientRectangle.Y \ 2), Width, 0)
  546.     End Sub
  547. End Class