daily pastebin goal
40%
SHARE
TWEET

-> Meph Theme <- [GDI] [10 Controls] [Customizable]

MephobiaHF May 1st, 2013 8,802 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System.Drawing.Drawing2D
  2. Imports System.ComponentModel
  3.  
  4. 'PLEASE LEAVE CREDITS IN SOURCE, DO NOT REDISTRIBUTE!
  5.  
  6. '--------------------- [ Theme ] --------------------
  7. 'Creator: Mephobia
  8. 'Contact: Mephobia.HF (Skype)
  9. 'Created: 4.20.2013
  10. 'Changed: 4.20.2013
  11. '-------------------- [ /Theme ] ---------------------
  12.  
  13. 'PLEASE LEAVE CREDITS IN SOURCE, DO NOT REDISTRIBUTE!
  14.  
  15. Enum MouseState As Byte
  16.     None = 0
  17.     Over = 1
  18.     Down = 2
  19.     Block = 3
  20. End Enum
  21. Module Draw
  22.     Public Function RoundRect(ByVal Rectangle As Rectangle, ByVal Curve As Integer) As GraphicsPath
  23.         Dim P As GraphicsPath = New GraphicsPath()
  24.         Dim ArcRectangleWidth As Integer = Curve * 2
  25.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  26.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  27.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  28.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  29.         P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
  30.         Return P
  31.     End Function
  32.     Public Function RoundRect(ByVal X As Integer, ByVal Y As Integer, ByVal Width As Integer, ByVal Height As Integer, ByVal Curve As Integer) As GraphicsPath
  33.         Dim Rectangle As Rectangle = New Rectangle(X, Y, Width, Height)
  34.         Dim P As GraphicsPath = New GraphicsPath()
  35.         Dim ArcRectangleWidth As Integer = Curve * 2
  36.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  37.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  38.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  39.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  40.         P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
  41.         Return P
  42.     End Function
  43.  
  44.     Public Sub InnerGlow(ByVal G As Graphics, ByVal Rectangle As Rectangle, ByVal Colors As Color())
  45.         Dim SubtractTwo As Integer = 1
  46.         Dim AddOne As Integer = 0
  47.         For Each c In Colors
  48.             G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(c.R, c.B, c.G))), Rectangle.X + AddOne, Rectangle.Y + AddOne, Rectangle.Width - SubtractTwo, Rectangle.Height - SubtractTwo)
  49.             SubtractTwo += 2
  50.             AddOne += 1
  51.         Next
  52.     End Sub
  53.     Public Sub InnerGlowRounded(ByVal G As Graphics, ByVal Rectangle As Rectangle, ByVal Degree As Integer, ByVal Colors As Color())
  54.         Dim SubtractTwo As Integer = 1
  55.         Dim AddOne As Integer = 0
  56.         For Each c In Colors
  57.             G.DrawPath(New Pen(New SolidBrush(Color.FromArgb(c.R, c.B, c.G))), Draw.RoundRect(Rectangle.X + AddOne, Rectangle.Y + AddOne, Rectangle.Width - SubtractTwo, Rectangle.Height - SubtractTwo, Degree))
  58.             SubtractTwo += 2
  59.             AddOne += 1
  60.         Next
  61.     End Sub
  62. End Module
  63. Public Class MephTheme : Inherits ContainerControl
  64.  
  65.     Private _subHeader As String
  66.     Public Property SubHeader() As String
  67.         Get
  68.             Return _subHeader
  69.         End Get
  70.         Set(ByVal value As String)
  71.             _subHeader = value
  72.             Invalidate()
  73.         End Set
  74.     End Property
  75.  
  76.     Private _accentColor As Color
  77.     Public Property AccentColor() As Color
  78.         Get
  79.             Return _accentColor
  80.         End Get
  81.         Set(ByVal value As Color)
  82.             _accentColor = value
  83.             Invalidate()
  84.         End Set
  85.     End Property
  86.  
  87.     Sub New()
  88.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  89.         BackColor = Color.FromArgb(28, 28, 28)
  90.         _subHeader = "Insert Sub Header"
  91.         _accentColor = Color.DarkRed
  92.         DoubleBuffered = True
  93.     End Sub
  94.  
  95.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  96.         Dim G As Graphics = e.Graphics
  97.  
  98.         Dim mainRect As New Rectangle(0, 0, Width, Height)
  99.  
  100.         MyBase.OnPaint(e)
  101.  
  102.  
  103.         G.Clear(Color.Fuchsia)
  104.         'G.SetClip(Draw.RoundRect(New Rectangle(0, 0, Width, Height), 9))
  105.  
  106.         Dim c As Color() = New Color() {Color.FromArgb(10, 10, 10), Color.FromArgb(45, 45, 45), Color.FromArgb(40, 40, 40), Color.FromArgb(45, 45, 45), Color.FromArgb(46, 46, 46), Color.FromArgb(47, 47, 47), Color.FromArgb(48, 48, 48), Color.FromArgb(49, 49, 49), Color.FromArgb(50, 50, 50)}
  107.         G.FillRectangle(New SolidBrush(Color.FromArgb(50, 50, 50)), mainRect)
  108.         InnerGlow(G, mainRect, c)
  109.  
  110.         Dim c2 As Color() = New Color() {Color.FromArgb(5, 5, 5), Color.FromArgb(40, 40, 40), Color.FromArgb(41, 41, 41), Color.FromArgb(42, 42, 42), Color.FromArgb(43, 43, 43), Color.FromArgb(44, 44, 44), Color.FromArgb(45, 45, 45)}
  111.         G.FillRectangle(New SolidBrush(Color.FromArgb(45, 45, 45)), New Rectangle(0, 35, Width, 23))
  112.         InnerGlow(G, New Rectangle(0, 35, Width, 23), c2)
  113.  
  114.         Dim accentGradient As New LinearGradientBrush(New Rectangle(0, 36, 11, 21), _accentColor, Color.FromArgb(IIf(_accentColor.R >= 10, _accentColor.R - 10, _accentColor.R + 10), IIf(_accentColor.G >= 10, _accentColor.G - 10, _accentColor.G + 10), IIf(_accentColor.B >= 10, _accentColor.B - 10, _accentColor.B + 10)), 90S)
  115.         G.FillRectangle(accentGradient, New Rectangle(0, 36, 11, 21))
  116.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(5, 5, 5))), New Rectangle(0, 35, 11, 22))
  117.         G.FillRectangle(accentGradient, New Rectangle(Width - 12, 36, 11, 21))
  118.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(5, 5, 5))), New Rectangle(Width - 12, 35, 11, 22))
  119.  
  120.         Dim gloss As New LinearGradientBrush(New Rectangle(1, 0, Width - 1, 35 / 2), Color.FromArgb(255, Color.FromArgb(90, 90, 90)), Color.FromArgb(255, 71, 71, 71), 90S)
  121.         G.FillRectangle(gloss, New Rectangle(1, 0, Width - 2, 35 / 2))
  122.  
  123.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(5, 5, 5))), 0, 0, Width, 0)
  124.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(150, 150, 150))), 1, 1, Width - 2, 1)
  125.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(85, 85, 85))), 1, 34, Width - 2, 34)
  126.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 1, 58, Width - 2, 58)
  127.  
  128.         Dim drawFont As New Font("Verdana", 10, FontStyle.Regular)
  129.         G.DrawString(Text, drawFont, New SolidBrush(Color.FromArgb(225, 225, 225)), New Rectangle(0, 0, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  130.  
  131.         Dim subFont As New Font("Verdana", 8, FontStyle.Regular)
  132.         G.DrawString(_subHeader, subFont, New SolidBrush(Color.FromArgb(225, 225, 225)), New Rectangle(0, 35, Width, 23), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  133.  
  134.         Dim controlFont As New Font("Marlett", 10, FontStyle.Regular)
  135.         Select Case State
  136.             Case MouseState.None
  137.                 G.DrawString("r", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-4, -6, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  138.                 G.DrawString("1", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-21, -5, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  139.                 G.DrawString("0", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-38, -6, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  140.             Case MouseState.Over
  141.                 If X > Width - 18 And X < Width - 10 And Y < 18 And Y > 8 Then
  142.                     G.DrawString("r", controlFont, New SolidBrush(Color.FromArgb(255, 255, 255)), New Rectangle(-4, -6, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  143.                     G.DrawString("1", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-21, -5, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  144.                     G.DrawString("0", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-38, -6, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  145.                 ElseIf X > Width - 36 And X < Width - 25 And Y < 18 And Y > 8 Then
  146.                     G.DrawString("r", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-4, -6, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  147.                     G.DrawString("1", controlFont, New SolidBrush(Color.FromArgb(255, 255, 255)), New Rectangle(-21, -5, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  148.                     G.DrawString("0", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-38, -6, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  149.                 ElseIf X > Width - 52 And X < Width - 44 And Y < 18 And Y > 8 Then
  150.                     G.DrawString("r", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-4, -6, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  151.                     G.DrawString("1", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-21, -5, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  152.                     G.DrawString("0", controlFont, New SolidBrush(Color.FromArgb(255, 255, 255)), New Rectangle(-38, -6, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  153.                 Else
  154.                     G.DrawString("r", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-4, -6, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  155.                     G.DrawString("1", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-21, -5, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  156.                     G.DrawString("0", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-38, -6, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  157.                 End If
  158.             Case MouseState.Down
  159.                 G.DrawString("r", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-4, -6, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  160.                 G.DrawString("1", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-21, -5, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  161.                 G.DrawString("0", controlFont, New SolidBrush(Color.FromArgb(178, 178, 178)), New Rectangle(-38, -6, Width, 35), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  162.         End Select
  163.  
  164.     End Sub
  165.     Private MouseP As Point = New Point(0, 0)
  166.     Private Cap As Boolean = False
  167.     Private MoveHeight% = 35 : Private pos% = 0
  168.     Dim State As MouseState = MouseState.None
  169.     Dim X As Integer
  170.     Dim Y As Integer
  171.     Dim MinBtn As New Rectangle(0, 0, 32, 25)
  172.     Dim CloseBtn As New Rectangle(33, 0, 65, 25)
  173.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  174.         MyBase.OnMouseDown(e)
  175.         If e.Button = Windows.Forms.MouseButtons.Left And New Rectangle(0, 0, Width, MoveHeight).Contains(e.Location) And X < Width - 53 Then
  176.             Cap = True
  177.             MouseP = e.Location
  178.         Else
  179.             If X > Width - 18 And X < Width - 8 And Y < 18 And Y > 8 Then
  180.                 FindForm.Close()
  181.             ElseIf X > Width - 36 And X < Width - 25 And Y < 18 And Y > 8 Then
  182.                 If FindForm.WindowState = FormWindowState.Maximized Then
  183.                     FindForm.WindowState = FormWindowState.Normal
  184.                 Else
  185.                     FindForm.WindowState = FormWindowState.Maximized
  186.                 End If
  187.             ElseIf X > Width - 52 And X < Width - 44 And Y < 18 And Y > 8 Then
  188.                 FindForm.WindowState = FormWindowState.Minimized
  189.             End If
  190.         End If
  191.         State = MouseState.Down
  192.         Invalidate()
  193.     End Sub
  194.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  195.         MyBase.OnMouseEnter(e)
  196.         State = MouseState.Over : Invalidate()
  197.     End Sub
  198.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  199.         MyBase.OnMouseLeave(e)
  200.         State = MouseState.None : Invalidate()
  201.     End Sub
  202.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  203.         MyBase.OnMouseUp(e) : Cap = False
  204.         State = MouseState.Over : Invalidate()
  205.     End Sub
  206.     Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)
  207.         MyBase.OnMouseMove(e)
  208.         If Cap Then
  209.             Parent.Location = MousePosition - MouseP
  210.         End If
  211.         X = e.Location.X
  212.         Y = e.Location.Y
  213.         Invalidate()
  214.     End Sub
  215.     Protected Overrides Sub OnCreateControl()
  216.         MyBase.OnCreateControl()
  217.         Me.ParentForm.FormBorderStyle = FormBorderStyle.None
  218.         Me.ParentForm.TransparencyKey = Color.Fuchsia
  219.         Dock = DockStyle.Fill
  220.     End Sub
  221. End Class
  222. Public Class MephButton : Inherits Control
  223. #Region " MouseStates "
  224.     Dim State As MouseState = MouseState.None
  225.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  226.         MyBase.OnMouseDown(e)
  227.         State = MouseState.Down : Invalidate()
  228.     End Sub
  229.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  230.         MyBase.OnMouseUp(e)
  231.         State = MouseState.Over : Invalidate()
  232.     End Sub
  233.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  234.         MyBase.OnMouseEnter(e)
  235.         State = MouseState.Over : Invalidate()
  236.     End Sub
  237.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  238.         MyBase.OnMouseLeave(e)
  239.         State = MouseState.None : Invalidate()
  240.     End Sub
  241. #End Region
  242.  
  243.     Sub New()
  244.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  245.         BackColor = Color.Transparent
  246.         ForeColor = Color.FromArgb(205, 205, 205)
  247.         DoubleBuffered = True
  248.     End Sub
  249.  
  250.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  251.         Dim B As New Bitmap(Width, Height)
  252.         Dim G As Graphics = Graphics.FromImage(B)
  253.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  254.  
  255.         MyBase.OnPaint(e)
  256.  
  257.         G.Clear(BackColor)
  258.         Dim drawFont As New Font("Verdana", 8, FontStyle.Regular)
  259.  
  260.         G.SmoothingMode = SmoothingMode.HighQuality
  261.  
  262.         G.FillPath(New SolidBrush(Color.FromArgb(40, 40, 40)), Draw.RoundRect(ClientRectangle, 3))
  263.         G.DrawPath(New Pen(New SolidBrush(Color.FromArgb(15, 15, 15))), Draw.RoundRect(ClientRectangle, 3))
  264.         G.DrawPath(New Pen(New SolidBrush(Color.FromArgb(55, 55, 55))), Draw.RoundRect(New Rectangle(1, 1, Width - 3, Height - 3), 3))
  265.  
  266.         Select Case State
  267.             Case MouseState.None
  268.                 G.DrawString(Text, drawFont, Brushes.Silver, New Rectangle(0, 0, Width - 1, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  269.             Case MouseState.Over
  270.                 G.DrawString(Text, drawFont, Brushes.White, New Rectangle(0, 0, Width - 1, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  271.             Case MouseState.Down
  272.                 G.DrawString(Text, drawFont, Brushes.Gray, New Rectangle(0, 0, Width - 1, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  273.         End Select
  274.  
  275.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  276.         G.Dispose() : B.Dispose()
  277.     End Sub
  278. End Class
  279. Public Class MephGroupBox : Inherits ContainerControl
  280.  
  281.     Enum HeaderLine
  282.         Enabled
  283.         Disabled
  284.     End Enum
  285.     Private _HeaderLine As HeaderLine
  286.     Public Property Header_Line() As HeaderLine
  287.         Get
  288.             Return _HeaderLine
  289.         End Get
  290.         Set(ByVal value As HeaderLine)
  291.             _HeaderLine = value
  292.             Invalidate()
  293.         End Set
  294.     End Property
  295.  
  296.     Sub New()
  297.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  298.         BackColor = Color.Transparent
  299.         ForeColor = Color.FromArgb(205, 205, 205)
  300.         Size = New Size(174, 115)
  301.         _HeaderLine = HeaderLine.Enabled
  302.         DoubleBuffered = True
  303.     End Sub
  304.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  305.         Dim B As New Bitmap(Width, Height)
  306.         Dim G As Graphics = Graphics.FromImage(B)
  307.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  308.  
  309.  
  310.         MyBase.OnPaint(e)
  311.  
  312.         G.Clear(BackColor)
  313.         Dim drawFont As New Font("Verdana", 8, FontStyle.Regular)
  314.  
  315.         G.SmoothingMode = SmoothingMode.HighQuality
  316.  
  317.         Dim c As Color() = New Color() {Color.FromArgb(20, 20, 20), Color.FromArgb(45, 45, 45), Color.FromArgb(40, 40, 40), Color.FromArgb(45, 45, 45), Color.FromArgb(46, 46, 46), Color.FromArgb(47, 47, 47), Color.FromArgb(48, 48, 48), Color.FromArgb(49, 49, 49), Color.FromArgb(50, 50, 50)}
  318.         G.FillRectangle(New SolidBrush(Color.FromArgb(50, 50, 50)), ClientRectangle)
  319.         Draw.InnerGlow(G, ClientRectangle, c)
  320.  
  321.         Select Case _HeaderLine
  322.             Case HeaderLine.Enabled
  323.                 G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 16, 29, Width - 17, 29)
  324.                 G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(20, 20, 20))), 15, 30, Width - 16, 30)
  325.                 G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 16, 31, Width - 17, 31)
  326.             Case HeaderLine.Disabled
  327.         End Select
  328.  
  329.         G.DrawString(Text, drawFont, Brushes.Silver, New Rectangle(0, 3, Width - 1, 27), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  330.  
  331.  
  332.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  333.         G.Dispose() : B.Dispose()
  334.     End Sub
  335. End Class
  336. <DefaultEvent("CheckedChanged")> Public Class MephToggleSwitch : Inherits Control
  337.  
  338. #Region " Control Help - MouseState & Flicker Control"
  339.     Private State As MouseState = MouseState.None
  340.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  341.         MyBase.OnMouseEnter(e)
  342.         State = MouseState.Over
  343.         Invalidate()
  344.     End Sub
  345.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  346.         MyBase.OnMouseDown(e)
  347.         State = MouseState.Down
  348.         Invalidate()
  349.     End Sub
  350.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  351.         MyBase.OnMouseLeave(e)
  352.         State = MouseState.None
  353.         Invalidate()
  354.     End Sub
  355.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  356.         MyBase.OnMouseUp(e)
  357.         State = MouseState.Over
  358.         Invalidate()
  359.     End Sub
  360.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  361.         MyBase.OnTextChanged(e)
  362.         Invalidate()
  363.     End Sub
  364.     Private _Checked As Boolean
  365.     Property Checked() As Boolean
  366.         Get
  367.             Return _Checked
  368.         End Get
  369.         Set(ByVal value As Boolean)
  370.             _Checked = value
  371.             Invalidate()
  372.         End Set
  373.     End Property
  374.     Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  375.         MyBase.OnResize(e)
  376.         Height = 24
  377.         Width = 50
  378.     End Sub
  379.     Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
  380.         _Checked = Not _Checked
  381.         RaiseEvent CheckedChanged(Me)
  382.         MyBase.OnClick(e)
  383.     End Sub
  384.     Event CheckedChanged(ByVal sender As Object)
  385. #End Region
  386.  
  387.     Sub New()
  388.         MyBase.New()
  389.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor Or ControlStyles.OptimizedDoubleBuffer, True)
  390.         BackColor = Color.Transparent
  391.         ForeColor = Color.Black
  392.         Size = New Size(50, 24)
  393.         DoubleBuffered = True
  394.     End Sub
  395.  
  396.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  397.         Dim B As New Bitmap(Width, Height)
  398.         Dim G As Graphics = Graphics.FromImage(B)
  399.         Dim onoffRect As New Rectangle(0, 0, Width - 1, Height - 1)
  400.  
  401.         G.SmoothingMode = SmoothingMode.HighQuality
  402.         G.CompositingQuality = CompositingQuality.HighQuality
  403.         G.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
  404.  
  405.         G.Clear(Color.Transparent)
  406.  
  407.         Dim bodyGrad As New LinearGradientBrush(onoffRect, Color.FromArgb(40, 40, 40), Color.FromArgb(45, 45, 45), 90S)
  408.         G.FillPath(bodyGrad, Draw.RoundRect(onoffRect, 4))
  409.         G.DrawPath(New Pen(Color.FromArgb(15, 15, 15)), Draw.RoundRect(onoffRect, 4))
  410.         G.DrawPath(New Pen(Color.FromArgb(50, 50, 50)), Draw.RoundRect(New Rectangle(1, 1, Width - 3, Height - 3), 4))
  411.  
  412.         If Checked Then
  413.             G.FillPath(New SolidBrush(Color.FromArgb(80, Color.Green)), Draw.RoundRect(New Rectangle(4, 2, 25, Height - 5), 4))
  414.             G.FillPath(New SolidBrush(Color.FromArgb(35, 35, 35)), Draw.RoundRect(New Rectangle(2, 2, 25, Height - 5), 4))
  415.             G.DrawPath(New Pen(New SolidBrush(Color.FromArgb(20, 20, 20))), Draw.RoundRect(New Rectangle(2, 2, 25, Height - 5), 4))
  416.             Select Case State
  417.                 Case MouseState.None
  418.                     G.DrawString("On", New Font("Tahoma", 8, FontStyle.Regular), Brushes.Silver, New Point(16, Height - 12), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  419.                 Case MouseState.Over
  420.                     G.DrawString("On", New Font("Tahoma", 8, FontStyle.Regular), Brushes.White, New Point(16, Height - 12), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  421.                 Case MouseState.Down
  422.                     G.DrawString("On", New Font("Tahoma", 8, FontStyle.Regular), Brushes.Silver, New Point(16, Height - 12), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  423.             End Select
  424.         Else
  425.             G.FillPath(New SolidBrush(Color.FromArgb(60, Color.Red)), Draw.RoundRect(New Rectangle((Width / 2) - 7, 2, Width - 25, Height - 5), 4))
  426.             G.FillPath(New SolidBrush(Color.FromArgb(35, 35, 35)), Draw.RoundRect(New Rectangle((Width / 2) - 5, 2, Width - 23, Height - 5), 4))
  427.             G.DrawPath(New Pen(New SolidBrush(Color.FromArgb(20, 20, 20))), Draw.RoundRect(New Rectangle((Width / 2) - 5, 2, Width - 23, Height - 5), 4))
  428.             Select Case State
  429.                 Case MouseState.None
  430.                     G.DrawString("Off", New Font("Tahoma", 8, FontStyle.Regular), Brushes.Silver, New Point(34, Height - 11), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  431.                 Case MouseState.Over
  432.                     G.DrawString("Off", New Font("Tahoma", 8, FontStyle.Regular), Brushes.White, New Point(34, Height - 11), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  433.                 Case MouseState.Down
  434.                     G.DrawString("Off", New Font("Tahoma", 8, FontStyle.Regular), Brushes.Silver, New Point(34, Height - 11), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  435.             End Select
  436.         End If
  437.  
  438.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  439.         G.Dispose() : B.Dispose()
  440.     End Sub
  441. End Class
  442. Public Class MephTextBox : Inherits Control
  443.     Dim WithEvents txtbox As New TextBox
  444.  
  445. #Region " Control Help - Properties & Flicker Control "
  446.     Private _passmask As Boolean = False
  447.     Public Shadows Property UseSystemPasswordChar() As Boolean
  448.         Get
  449.             Return _passmask
  450.         End Get
  451.         Set(ByVal v As Boolean)
  452.             txtbox.UseSystemPasswordChar = UseSystemPasswordChar
  453.             _passmask = v
  454.             Invalidate()
  455.         End Set
  456.     End Property
  457.     Private _maxchars As Integer = 32767
  458.     Public Shadows Property MaxLength() As Integer
  459.         Get
  460.             Return _maxchars
  461.         End Get
  462.         Set(ByVal v As Integer)
  463.             _maxchars = v
  464.             txtbox.MaxLength = MaxLength
  465.             Invalidate()
  466.         End Set
  467.     End Property
  468.     Private _align As HorizontalAlignment
  469.     Public Shadows Property TextAlignment() As HorizontalAlignment
  470.         Get
  471.             Return _align
  472.         End Get
  473.         Set(ByVal v As HorizontalAlignment)
  474.             _align = v
  475.             Invalidate()
  476.         End Set
  477.     End Property
  478.     Private _multiline As Boolean = False
  479.     Public Shadows Property MultiLine() As Boolean
  480.         Get
  481.             Return _multiline
  482.         End Get
  483.         Set(ByVal value As Boolean)
  484.             _multiline = value
  485.             Invalidate()
  486.         End Set
  487.     End Property
  488.     Private _wordwrap As Boolean = False
  489.     Public Shadows Property WordWrap() As Boolean
  490.         Get
  491.             Return _wordwrap
  492.         End Get
  493.         Set(ByVal value As Boolean)
  494.             _wordwrap = value
  495.             Invalidate()
  496.         End Set
  497.     End Property
  498.  
  499.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  500.     End Sub
  501.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  502.         MyBase.OnTextChanged(e)
  503.         Invalidate()
  504.     End Sub
  505.     Protected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)
  506.         MyBase.OnBackColorChanged(e)
  507.         txtbox.BackColor = BackColor
  508.         Invalidate()
  509.     End Sub
  510.     Protected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)
  511.         MyBase.OnForeColorChanged(e)
  512.         txtbox.ForeColor = ForeColor
  513.         Invalidate()
  514.     End Sub
  515.     Protected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)
  516.         MyBase.OnFontChanged(e)
  517.         txtbox.Font = Font
  518.     End Sub
  519.     Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
  520.         MyBase.OnGotFocus(e)
  521.         txtbox.Focus()
  522.     End Sub
  523.     Sub TextChngTxtBox() Handles txtbox.TextChanged
  524.         Text = txtbox.Text
  525.     End Sub
  526.     Sub TextChng() Handles MyBase.TextChanged
  527.         txtbox.Text = Text
  528.     End Sub
  529.     Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  530.         MyBase.OnResize(e)
  531.         If MultiLine = False Then
  532.             Height = 24
  533.         End If
  534.     End Sub
  535.     Sub NewTextBox()
  536.         With txtbox
  537.             .Multiline = MultiLine
  538.             .BackColor = Color.FromArgb(50, 50, 50)
  539.             .ForeColor = ForeColor
  540.             .Text = String.Empty
  541.             .TextAlign = HorizontalAlignment.Center
  542.             .BorderStyle = BorderStyle.None
  543.             .Location = New Point(5, 4)
  544.             .Font = New Font("Verdana", 8, FontStyle.Regular)
  545.             If MultiLine = True Then
  546.                 If WordWrap = True Then
  547.                     .WordWrap = True
  548.                 Else
  549.                     .WordWrap = False
  550.                 End If
  551.             Else
  552.                 If WordWrap = True Then
  553.                     .WordWrap = True
  554.                 Else
  555.                     .WordWrap = False
  556.                 End If
  557.             End If
  558.             .Size = New Size(Width - 10, Height - 11)
  559.             .UseSystemPasswordChar = UseSystemPasswordChar
  560.         End With
  561.  
  562.     End Sub
  563. #End Region
  564.  
  565.     Sub New()
  566.         MyBase.New()
  567.  
  568.         NewTextBox()
  569.         Controls.Add(txtbox)
  570.         Text = ""
  571.         BackColor = Color.FromArgb(50, 50, 50)
  572.         ForeColor = Color.Silver
  573.         Size = New Size(135, 24)
  574.         DoubleBuffered = True
  575.     End Sub
  576.  
  577.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  578.         Dim B As New Bitmap(Width, Height)
  579.         Dim G As Graphics = Graphics.FromImage(B)
  580.         G.SmoothingMode = SmoothingMode.HighQuality
  581.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  582.  
  583.         With txtbox
  584.             .Multiline = MultiLine
  585.             If MultiLine = False Then
  586.                 Height = txtbox.Height + 11
  587.                 If WordWrap = True Then
  588.                     .WordWrap = True
  589.                 Else
  590.                     .WordWrap = False
  591.                 End If
  592.             Else
  593.                 txtbox.Height = Height - 11
  594.                 If WordWrap = True Then
  595.                     .WordWrap = True
  596.                 Else
  597.                     .WordWrap = False
  598.                 End If
  599.             End If
  600.             .Width = Width - 10
  601.             .TextAlign = TextAlignment
  602.             .UseSystemPasswordChar = UseSystemPasswordChar
  603.         End With
  604.  
  605.         G.Clear(BackColor)
  606.  
  607.         Dim c As Color() = New Color() {Color.FromArgb(20, 20, 20), Color.FromArgb(40, 40, 40), Color.FromArgb(45, 45, 45), Color.FromArgb(46, 46, 46), Color.FromArgb(47, 47, 47), Color.FromArgb(48, 48, 48), Color.FromArgb(49, 49, 49), Color.FromArgb(50, 50, 50)}
  608.         G.FillPath(New SolidBrush(Color.FromArgb(50, 50, 50)), Draw.RoundRect(ClientRectangle, 3))
  609.         Draw.InnerGlowRounded(G, ClientRectangle, 3, c)
  610.  
  611.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  612.         G.Dispose() : B.Dispose()
  613.     End Sub
  614. End Class
  615. Public Class MephProgressBar : Inherits Control
  616.  
  617. #Region " Control Help - Properties & Flicker Control "
  618.     Private OFS As Integer = 0
  619.     Private Speed As Integer = 50
  620.     Private _Maximum As Integer = 100
  621.  
  622.     Public Property Maximum() As Integer
  623.         Get
  624.             Return _Maximum
  625.         End Get
  626.         Set(ByVal v As Integer)
  627.             Select Case v
  628.                 Case Is < _Value
  629.                     _Value = v
  630.             End Select
  631.             _Maximum = v
  632.             Invalidate()
  633.         End Set
  634.     End Property
  635.     Private _Value As Integer = 0
  636.     Public Property Value() As Integer
  637.         Get
  638.             Select Case _Value
  639.                 Case 0
  640.                     Return 0
  641.                 Case Else
  642.                     Return _Value
  643.             End Select
  644.         End Get
  645.         Set(ByVal v As Integer)
  646.             Select Case v
  647.                 Case Is > _Maximum
  648.                     v = _Maximum
  649.             End Select
  650.             _Value = v
  651.             Invalidate()
  652.         End Set
  653.     End Property
  654.     Private _ShowPercentage As Boolean = False
  655.     Public Property ShowPercentage() As Boolean
  656.         Get
  657.             Return _ShowPercentage
  658.         End Get
  659.         Set(ByVal v As Boolean)
  660.             _ShowPercentage = v
  661.             Invalidate()
  662.         End Set
  663.     End Property
  664.  
  665.     Protected Overrides Sub CreateHandle()
  666.         MyBase.CreateHandle()
  667.     End Sub
  668.     Sub Animate()
  669.         While True
  670.             If OFS <= Width Then : OFS += 1
  671.             Else : OFS = 0
  672.             End If
  673.             Invalidate()
  674.             Threading.Thread.Sleep(Speed)
  675.         End While
  676.     End Sub
  677. #End Region
  678.  
  679.     Sub New()
  680.         MyBase.New()
  681.         DoubleBuffered = True
  682.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  683.         BackColor = Color.Transparent
  684.     End Sub
  685.  
  686.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  687.         Dim B As New Bitmap(Width, Height)
  688.         Dim G As Graphics = Graphics.FromImage(B)
  689.  
  690.         G.SmoothingMode = SmoothingMode.HighQuality
  691.  
  692.         Dim intValue As Integer = CInt(_Value / _Maximum * Width)
  693.         G.Clear(BackColor)
  694.  
  695.         Dim percentColor As SolidBrush = New SolidBrush(Color.White)
  696.  
  697.         Dim c As Color() = New Color() {Color.FromArgb(20, 20, 20), Color.FromArgb(40, 40, 40), Color.FromArgb(45, 45, 45), Color.FromArgb(46, 46, 46), Color.FromArgb(47, 47, 47), Color.FromArgb(48, 48, 48), Color.FromArgb(49, 49, 49), Color.FromArgb(50, 50, 50)}
  698.         G.FillPath(New SolidBrush(Color.FromArgb(50, 50, 50)), Draw.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 3))
  699.         Draw.InnerGlowRounded(G, ClientRectangle, 3, c)
  700.  
  701.         '//// Bar Fill
  702.         If Not intValue = 0 Then
  703.             G.FillPath(New LinearGradientBrush(New Rectangle(1, 1, intValue, Height - 3), Color.FromArgb(30, 30, 30), Color.FromArgb(35, 35, 35), 90S), Draw.RoundRect(New Rectangle(1, 1, intValue, Height - 3), 2))
  704.             G.DrawPath(New Pen(Color.FromArgb(45, 45, 45)), Draw.RoundRect(New Rectangle(1, 1, intValue, Height - 3), 2))
  705.             'G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(15, 15, 15))), intValue + 1, 3, intValue + 1, Height - 4)
  706.             percentColor = New SolidBrush(Color.White)
  707.         End If
  708.  
  709.  
  710.  
  711.         If _ShowPercentage Then
  712.             G.DrawString(Convert.ToString(String.Concat(Value, "%")), New Font("Tahoma", 9, FontStyle.Bold), percentColor, New Rectangle(0, 1, Width - 1, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  713.         End If
  714.  
  715.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  716.         G.Dispose() : B.Dispose()
  717.     End Sub
  718. End Class
  719. <DefaultEvent("CheckedChanged")> Public Class MephRadioButton : Inherits Control
  720.  
  721. #Region " Control Help - MouseState & Flicker Control"
  722.     Private R1 As Rectangle
  723.     Private G1 As LinearGradientBrush
  724.  
  725.     Private State As MouseState = MouseState.None
  726.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  727.         MyBase.OnMouseEnter(e)
  728.         State = MouseState.Over
  729.         Invalidate()
  730.     End Sub
  731.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  732.         MyBase.OnMouseDown(e)
  733.         State = MouseState.Down
  734.         Invalidate()
  735.     End Sub
  736.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  737.         MyBase.OnMouseLeave(e)
  738.         State = MouseState.None
  739.         Invalidate()
  740.     End Sub
  741.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  742.         MyBase.OnMouseUp(e)
  743.         State = MouseState.Over
  744.         Invalidate()
  745.     End Sub
  746.     Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  747.         MyBase.OnResize(e)
  748.         Height = 24
  749.     End Sub
  750.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  751.         MyBase.OnTextChanged(e)
  752.         Invalidate()
  753.     End Sub
  754.     Private _Checked As Boolean
  755.     Property Checked() As Boolean
  756.         Get
  757.             Return _Checked
  758.         End Get
  759.         Set(ByVal value As Boolean)
  760.             _Checked = value
  761.             InvalidateControls()
  762.             RaiseEvent CheckedChanged(Me)
  763.             Invalidate()
  764.         End Set
  765.     End Property
  766.     Protected Overrides Sub OnClick(ByVal e As EventArgs)
  767.         If Not _Checked Then Checked = True
  768.         MyBase.OnClick(e)
  769.     End Sub
  770.     Event CheckedChanged(ByVal sender As Object)
  771.     Protected Overrides Sub OnCreateControl()
  772.         MyBase.OnCreateControl()
  773.         InvalidateControls()
  774.     End Sub
  775.     Private Sub InvalidateControls()
  776.         If Not IsHandleCreated OrElse Not _Checked Then Return
  777.  
  778.         For Each C As Control In Parent.Controls
  779.             If C IsNot Me AndAlso TypeOf C Is MephRadioButton Then
  780.                 DirectCast(C, MephRadioButton).Checked = False
  781.             End If
  782.         Next
  783.     End Sub
  784.  
  785.     Private _accentColor As Color
  786.     Public Property AccentColor() As Color
  787.         Get
  788.             Return _accentColor
  789.         End Get
  790.         Set(ByVal value As Color)
  791.             _accentColor = value
  792.             Invalidate()
  793.         End Set
  794.     End Property
  795. #End Region
  796.  
  797.     Sub New()
  798.         MyBase.New()
  799.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  800.         BackColor = Color.Transparent
  801.         ForeColor = Color.Black
  802.         Size = New Size(150, 24)
  803.         _accentColor = Color.Maroon
  804.         DoubleBuffered = True
  805.     End Sub
  806.  
  807.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  808.         Dim B As New Bitmap(Width, Height)
  809.         Dim G As Graphics = Graphics.FromImage(B)
  810.         Dim radioBtnRectangle As New Rectangle(0, 0, Height - 1, Height - 1)
  811.         Dim InnerRect As New Rectangle(5, 5, Height - 11, Height - 11)
  812.  
  813.         G.SmoothingMode = SmoothingMode.HighQuality
  814.         G.CompositingQuality = CompositingQuality.HighQuality
  815.         G.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
  816.  
  817.         G.Clear(BackColor)
  818.  
  819.         Dim bgGrad As New LinearGradientBrush(radioBtnRectangle, Color.FromArgb(50, 50, 50), Color.FromArgb(40, 40, 40), 90S)
  820.         G.FillRectangle(bgGrad, radioBtnRectangle)
  821.         G.DrawRectangle(New Pen(Color.FromArgb(20, 20, 20)), radioBtnRectangle)
  822.         G.DrawRectangle(New Pen(Color.FromArgb(55, 55, 55)), New Rectangle(1, 1, Height - 3, Height - 3))
  823.  
  824.         If Checked Then
  825.             Dim fillGradient As New LinearGradientBrush(InnerRect, _accentColor, Color.FromArgb(_accentColor.R + 5, _accentColor.G + 5, _accentColor.B + 5), 90S)
  826.             G.FillRectangle(fillGradient, InnerRect)
  827.             G.DrawRectangle(New Pen(Color.FromArgb(25, 25, 25)), InnerRect)
  828.         End If
  829.  
  830.         Dim drawFont As New Font("Tahoma", 10, FontStyle.Bold)
  831.         Dim nb As Brush = New SolidBrush(Color.FromArgb(200, 200, 200))
  832.         G.DrawString(Text, drawFont, nb, New Point(28, 12), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center})
  833.  
  834.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  835.         G.Dispose() : B.Dispose()
  836.     End Sub
  837.  
  838. End Class
  839. Public Class MephComboBox : Inherits ComboBox
  840. #Region " Control Help - Properties & Flicker Control "
  841.     Private _StartIndex As Integer = 0
  842.     Public Property StartIndex As Integer
  843.         Get
  844.             Return _StartIndex
  845.         End Get
  846.         Set(ByVal value As Integer)
  847.             _StartIndex = value
  848.             Try
  849.                 MyBase.SelectedIndex = value
  850.             Catch
  851.             End Try
  852.             Invalidate()
  853.         End Set
  854.     End Property
  855.     Public Overrides ReadOnly Property DisplayRectangle As System.Drawing.Rectangle
  856.         Get
  857.             Return MyBase.DisplayRectangle
  858.         End Get
  859.     End Property
  860.     Sub ReplaceItem(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles Me.DrawItem
  861.         e.DrawBackground()
  862.         Try
  863.             If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then
  864.                 e.Graphics.FillRectangle(New SolidBrush(_highlightColor), e.Bounds)
  865.                 Dim gloss As New LinearGradientBrush(e.Bounds, Color.FromArgb(30, Color.White), Color.FromArgb(0, Color.White), 90S) 'Highlight Gloss/Color
  866.                 e.Graphics.FillRectangle(gloss, New Rectangle(New Point(e.Bounds.X, e.Bounds.Y), New Size(e.Bounds.Width, e.Bounds.Height))) 'Drop Background
  867.                 e.Graphics.DrawRectangle(New Pen(Color.FromArgb(90, Color.Black)) With {.DashStyle = DashStyle.Solid}, New Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height - 1))
  868.             Else
  869.                 e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(40, 40, 40)), e.Bounds)
  870.             End If
  871.             Using b As New SolidBrush(Color.Silver)
  872.                 e.Graphics.DrawString(MyBase.GetItemText(MyBase.Items(e.Index)), e.Font, b, New Rectangle(e.Bounds.X + 2, e.Bounds.Y, e.Bounds.Width - 4, e.Bounds.Height))
  873.             End Using
  874.         Catch
  875.         End Try
  876.         e.DrawFocusRectangle()
  877.     End Sub
  878.     Protected Sub DrawTriangle(ByVal Clr As Color, ByVal FirstPoint As Point, ByVal SecondPoint As Point, ByVal ThirdPoint As Point, ByVal FirstPoint2 As Point, ByVal SecondPoint2 As Point, ByVal ThirdPoint2 As Point, ByVal G As Graphics)
  879.         Dim points As New List(Of Point)()
  880.         points.Add(FirstPoint)
  881.         points.Add(SecondPoint)
  882.         points.Add(ThirdPoint)
  883.         G.FillPolygon(New SolidBrush(Clr), points.ToArray)
  884.         G.DrawPolygon(New Pen(New SolidBrush(Color.FromArgb(25, 25, 25))), points.ToArray)
  885.  
  886.         Dim points2 As New List(Of Point)()
  887.         points2.Add(FirstPoint2)
  888.         points2.Add(SecondPoint2)
  889.         points2.Add(ThirdPoint2)
  890.         G.FillPolygon(New SolidBrush(Clr), points2.ToArray)
  891.         G.DrawPolygon(New Pen(New SolidBrush(Color.FromArgb(25, 25, 25))), points2.ToArray)
  892.     End Sub
  893.     Private _highlightColor As Color = Color.FromArgb(55, 55, 55)
  894.     Public Property ItemHighlightColor() As Color
  895.         Get
  896.             Return _highlightColor
  897.         End Get
  898.         Set(ByVal v As Color)
  899.             _highlightColor = v
  900.             Invalidate()
  901.         End Set
  902.     End Property
  903. #End Region
  904.  
  905.     Sub New()
  906.         MyBase.New()
  907.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint Or ControlStyles.DoubleBuffer Or ControlStyles.SupportsTransparentBackColor, True)
  908.         DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
  909.         BackColor = Color.Transparent
  910.         ForeColor = Color.Silver
  911.         Font = New Font("Verdana", 8, FontStyle.Regular)
  912.         DropDownStyle = ComboBoxStyle.DropDownList
  913.         DoubleBuffered = True
  914.         Size = New Size(Width, 21)
  915.         ItemHeight = 16
  916.     End Sub
  917.  
  918.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  919.         Dim B As New Bitmap(Width, Height)
  920.         Dim G As Graphics = Graphics.FromImage(B)
  921.         G.SmoothingMode = SmoothingMode.HighQuality
  922.  
  923.  
  924.         G.Clear(BackColor)
  925.         Dim bodyGradNone As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height - 2), Color.FromArgb(40, 40, 40), Color.FromArgb(40, 40, 40), 90S)
  926.         G.FillPath(bodyGradNone, Draw.RoundRect(New Rectangle(bodyGradNone.Rectangle.X, bodyGradNone.Rectangle.Y, bodyGradNone.Rectangle.Width, bodyGradNone.Rectangle.Height), 3))
  927.         Dim bodyInBorderNone As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height - 3), Color.FromArgb(40, 40, 40), Color.FromArgb(40, 40, 40), 90S)
  928.         G.DrawPath(New Pen(bodyInBorderNone), Draw.RoundRect(New Rectangle(1, 1, Width - 3, Height - 4), 3))
  929.         G.DrawPath(New Pen(Color.FromArgb(20, 20, 20)), Draw.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 3)) 'Outer Line
  930.         G.DrawPath(New Pen(Color.FromArgb(55, 55, 55)), Draw.RoundRect(New Rectangle(1, 1, Width - 3, Height - 3), 3)) 'Inner Line
  931.         DrawTriangle(Color.FromArgb(60, 60, 60), New Point(Width - 14, 12), New Point(Width - 7, 12), New Point(Width - 11, 16), New Point(Width - 14, 10), New Point(Width - 7, 10), New Point(Width - 11, 5), G) 'Triangle Fill Color
  932.  
  933.         'Draw Separator line
  934.         G.DrawLine(New Pen(Color.FromArgb(45, 45, 45)), New Point(Width - 21, 2), New Point(Width - 21, Height - 3))
  935.         G.DrawLine(New Pen(Color.FromArgb(55, 55, 55)), New Point(Width - 20, 1), New Point(Width - 20, Height - 3))
  936.         G.DrawLine(New Pen(Color.FromArgb(45, 45, 45)), New Point(Width - 19, 2), New Point(Width - 19, Height - 3))
  937.         Try
  938.             G.DrawString(Text, Font, New SolidBrush(ForeColor), New Rectangle(5, 0, Width - 20, Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Near})
  939.         Catch
  940.         End Try
  941.  
  942.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  943.         G.Dispose() : B.Dispose()
  944.     End Sub
  945. End Class
  946. Class MephTabcontrol
  947.     Inherits TabControl
  948.     Public Function RoundRect(ByVal Rectangle As Rectangle, ByVal Curve As Integer) As GraphicsPath
  949.         Dim P As GraphicsPath = New GraphicsPath()
  950.         Dim ArcRectangleWidth As Integer = Curve * 2
  951.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  952.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  953.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  954.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  955.         P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
  956.         Return P
  957.     End Function
  958.     Public Function RoundRect(ByVal X As Integer, ByVal Y As Integer, ByVal Width As Integer, ByVal Height As Integer, ByVal Curve As Integer) As GraphicsPath
  959.         Dim Rectangle As Rectangle = New Rectangle(X, Y, Width, Height)
  960.         Dim P As GraphicsPath = New GraphicsPath()
  961.         Dim ArcRectangleWidth As Integer = Curve * 2
  962.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  963.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  964.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  965.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  966.         P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
  967.         Return P
  968.     End Function
  969.     Sub New()
  970.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint Or ControlStyles.DoubleBuffer, True)
  971.         DoubleBuffered = True
  972.         SizeMode = TabSizeMode.Fixed
  973.         ItemSize = New Size(35, 85)
  974.     End Sub
  975.     Protected Overrides Sub CreateHandle()
  976.         MyBase.CreateHandle()
  977.         Alignment = TabAlignment.Left
  978.     End Sub
  979.  
  980.     Function ToPen(ByVal color As Color) As Pen
  981.         Return New Pen(color)
  982.     End Function
  983.  
  984.     Function ToBrush(ByVal color As Color) As Brush
  985.         Return New SolidBrush(color)
  986.     End Function
  987.  
  988.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  989.         Dim B As New Bitmap(Width, Height)
  990.         Dim G As Graphics = Graphics.FromImage(B)
  991.         Dim FF As New Font("Verdana", 8, FontStyle.Regular)
  992.         Try : SelectedTab.BackColor = Color.FromArgb(50, 50, 50) : Catch : End Try
  993.         G.Clear(Parent.FindForm.BackColor)
  994.  
  995.         G.FillRectangle(New SolidBrush(Color.FromArgb(50, 50, 50)), New Rectangle(0, 0, ItemSize.Height + 3, Height - 1)) 'Full Tab Background
  996.  
  997.         For i = 0 To TabCount - 1
  998.             If i = SelectedIndex Then
  999.                 Dim x2 As Rectangle = New Rectangle(New Point(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2), New Size(GetTabRect(i).Width + 3, GetTabRect(i).Height - 1))
  1000.                 Dim myBlend As New ColorBlend()
  1001.                 myBlend.Colors = {Color.FromArgb(50, 50, 50), Color.FromArgb(50, 50, 50), Color.FromArgb(50, 50, 50)} 'Full Tab Background Gradient Accents
  1002.                 myBlend.Positions = {0.0F, 0.5F, 1.0F}
  1003.                 Dim lgBrush As New LinearGradientBrush(x2, Color.Black, Color.Black, 90.0F)
  1004.                 lgBrush.InterpolationColors = myBlend
  1005.                 G.FillRectangle(lgBrush, x2)
  1006.                 'G.DrawRectangle(New Pen(Color.FromArgb(20, 20, 20)), x2) 'Full Tab Highlight Outline
  1007.                 Dim tabRect As New Rectangle(GetTabRect(i).Location.X + 4, GetTabRect(i).Location.Y + 2, GetTabRect(i).Size.Width + 10, GetTabRect(i).Size.Height - 11)
  1008.                 G.FillPath(New SolidBrush(Color.FromArgb(50, 50, 50)), RoundRect(tabRect, 4)) 'Highlight Fill Background
  1009.  
  1010.                 Dim cFull As Color() = New Color() {Color.FromArgb(20, 20, 20), Color.FromArgb(40, 40, 40), Color.FromArgb(45, 45, 45), Color.FromArgb(46, 46, 46), Color.FromArgb(47, 47, 47), Color.FromArgb(48, 48, 48), Color.FromArgb(49, 49, 49), Color.FromArgb(50, 50, 50)}
  1011.                 Draw.InnerGlow(G, New Rectangle(0, 0, ItemSize.Height + 3, Height - 1), cFull) ' Main Left Box Outline
  1012.  
  1013.                 Dim cHighlight As Color() = New Color() {Color.FromArgb(20, 20, 20), Color.FromArgb(40, 40, 40), Color.FromArgb(45, 45, 45), Color.FromArgb(46, 46, 46), Color.FromArgb(47, 47, 47), Color.FromArgb(48, 48, 48), Color.FromArgb(49, 49, 49), Color.FromArgb(50, 50, 50)}
  1014.                 Draw.InnerGlowRounded(G, tabRect, 4, cHighlight) ' Fill HighLight Inner
  1015.  
  1016.                 G.SmoothingMode = SmoothingMode.HighQuality
  1017.                 'Dim p() As Point = {New Point(ItemSize.Height - 3, GetTabRect(i).Location.Y + 20), New Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 14), New Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 27)}
  1018.                 'G.FillPolygon(Brushes.White, p)
  1019.  
  1020.                 If ImageList IsNot Nothing Then
  1021.                     Try
  1022.                         If ImageList.Images(TabPages(i).ImageIndex) IsNot Nothing Then
  1023.  
  1024.                             G.DrawImage(ImageList.Images(TabPages(i).ImageIndex), New Point(x2.Location.X + 8, x2.Location.Y + 6))
  1025.                             G.DrawString("      " & TabPages(i).Text.ToUpper, New Font(Font.FontFamily, Font.Size, FontStyle.Regular), Brushes.White, New Rectangle(x2.X, x2.Y - 1, x2.Width, x2.Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  1026.                         Else
  1027.                             G.DrawString(TabPages(i).Text, FF, Brushes.White, New Rectangle(x2.X, x2.Y - 1, x2.Width, x2.Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  1028.                         End If
  1029.                     Catch ex As Exception
  1030.                         G.DrawString(TabPages(i).Text, FF, Brushes.White, New Rectangle(x2.X, x2.Y - 1, x2.Width, x2.Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  1031.                     End Try
  1032.                 Else
  1033.                     G.DrawString(TabPages(i).Text, FF, Brushes.White, New Rectangle(x2.X, x2.Y - 1, x2.Width, x2.Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  1034.                 End If
  1035.  
  1036.                 G.DrawLine(New Pen(Color.FromArgb(96, 110, 121)), New Point(x2.Location.X - 1, x2.Location.Y - 1), New Point(x2.Location.X, x2.Location.Y))
  1037.                 G.DrawLine(New Pen(Color.FromArgb(96, 110, 121)), New Point(x2.Location.X - 1, x2.Bottom - 1), New Point(x2.Location.X, x2.Bottom))
  1038.             Else
  1039.                 Dim x2 As Rectangle = New Rectangle(New Point(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2), New Size(GetTabRect(i).Width + 3, GetTabRect(i).Height + 1))
  1040.                 'G.FillRectangle(New SolidBrush(Color.FromArgb(50, 50, 50)), x2) 'Tab Highlight
  1041.                 G.DrawLine(New Pen(Color.FromArgb(96, 110, 121)), New Point(x2.Right, x2.Top), New Point(x2.Right, x2.Bottom))
  1042.                 If ImageList IsNot Nothing Then
  1043.                     Try
  1044.                         If ImageList.Images(TabPages(i).ImageIndex) IsNot Nothing Then
  1045.                             G.DrawImage(ImageList.Images(TabPages(i).ImageIndex), New Point(x2.Location.X + 8, x2.Location.Y + 6))
  1046.                             G.DrawString("      " & TabPages(i).Text, Font, Brushes.White, New Rectangle(x2.X, x2.Y - 1, x2.Width, x2.Height), New StringFormat With {.LineAlignment = StringAlignment.Near, .Alignment = StringAlignment.Near})
  1047.                         Else
  1048.                             G.DrawString(TabPages(i).Text, FF, New SolidBrush(Color.FromArgb(210, 220, 230)), New Rectangle(x2.X, x2.Y - 1, x2.Width, x2.Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  1049.                         End If
  1050.                     Catch ex As Exception
  1051.                         G.DrawString(TabPages(i).Text, FF, New SolidBrush(Color.FromArgb(210, 220, 230)), New Rectangle(x2.X, x2.Y - 1, x2.Width, x2.Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  1052.                     End Try
  1053.                 Else
  1054.                     G.DrawString(TabPages(i).Text, FF, New SolidBrush(Color.FromArgb(210, 220, 230)), New Rectangle(x2.X, x2.Y - 1, x2.Width, x2.Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  1055.                 End If
  1056.             End If
  1057.             G.FillRectangle(New SolidBrush(Color.FromArgb(50, 50, 50)), New Rectangle(86, -1, Width - 86, Height + 1)) 'Page Fill Full
  1058.  
  1059.             Dim c As Color() = New Color() {Color.FromArgb(20, 20, 20), Color.FromArgb(40, 40, 40), Color.FromArgb(45, 45, 45), Color.FromArgb(46, 46, 46), Color.FromArgb(47, 47, 47), Color.FromArgb(48, 48, 48), Color.FromArgb(49, 49, 49), Color.FromArgb(50, 50, 50)}
  1060.             Draw.InnerGlowRounded(G, New Rectangle(86, 0, Width - 87, Height - 1), 3, c) ' Fill Page
  1061.         Next
  1062.  
  1063.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(50, 50, 50))), New Rectangle(0, 0, ItemSize.Height + 4, Height - 1)) 'Full Tab Outer Outline
  1064.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(20, 20, 20))), New Rectangle(1, 0, ItemSize.Height + 3, Height - 2)) 'Full Tab Inner Outline
  1065.  
  1066.         e.Graphics.DrawImage(B.Clone, 0, 0)
  1067.         G.Dispose() : B.Dispose()
  1068.     End Sub
  1069. End Class
  1070. <DefaultEvent("CheckedChanged")> Public Class MephCheckBox : Inherits Control
  1071.  
  1072. #Region " Control Help - MouseState & Flicker Control"
  1073.     Private State As MouseState = MouseState.None
  1074.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  1075.         MyBase.OnMouseEnter(e)
  1076.         State = MouseState.Over
  1077.         Invalidate()
  1078.     End Sub
  1079.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  1080.         MyBase.OnMouseDown(e)
  1081.         State = MouseState.Down
  1082.         Invalidate()
  1083.     End Sub
  1084.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  1085.         MyBase.OnMouseLeave(e)
  1086.         State = MouseState.None
  1087.         Invalidate()
  1088.     End Sub
  1089.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  1090.         MyBase.OnMouseUp(e)
  1091.         State = MouseState.Over
  1092.         Invalidate()
  1093.     End Sub
  1094.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  1095.         MyBase.OnTextChanged(e)
  1096.         Invalidate()
  1097.     End Sub
  1098.     Private _Checked As Boolean
  1099.     Property Checked() As Boolean
  1100.         Get
  1101.             Return _Checked
  1102.         End Get
  1103.         Set(ByVal value As Boolean)
  1104.             _Checked = value
  1105.             Invalidate()
  1106.         End Set
  1107.     End Property
  1108.     Private _accentColor As Color
  1109.     Public Property AccentColor() As Color
  1110.         Get
  1111.             Return _accentColor
  1112.         End Get
  1113.         Set(ByVal value As Color)
  1114.             _accentColor = value
  1115.             Invalidate()
  1116.         End Set
  1117.     End Property
  1118.     Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  1119.         MyBase.OnResize(e)
  1120.         Height = 24
  1121.     End Sub
  1122.     Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
  1123.         _Checked = Not _Checked
  1124.         RaiseEvent CheckedChanged(Me)
  1125.         MyBase.OnClick(e)
  1126.     End Sub
  1127.     Event CheckedChanged(ByVal sender As Object)
  1128. #End Region
  1129.  
  1130.  
  1131.     Sub New()
  1132.         MyBase.New()
  1133.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor Or ControlStyles.OptimizedDoubleBuffer, True)
  1134.         BackColor = Color.Transparent
  1135.         ForeColor = Color.Black
  1136.         Size = New Size(250, 24)
  1137.         _accentColor = Color.Maroon
  1138.         DoubleBuffered = True
  1139.     End Sub
  1140.  
  1141.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  1142.         Dim B As New Bitmap(Width, Height)
  1143.         Dim G As Graphics = Graphics.FromImage(B)
  1144.         Dim radioBtnRectangle As New Rectangle(0, 0, Height - 1, Height - 1)
  1145.         Dim InnerRect As New Rectangle(5, 5, Height - 11, Height - 11)
  1146.  
  1147.         G.SmoothingMode = SmoothingMode.HighQuality
  1148.         G.CompositingQuality = CompositingQuality.HighQuality
  1149.         G.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
  1150.  
  1151.         G.Clear(BackColor)
  1152.  
  1153.         Dim bgGrad As New LinearGradientBrush(radioBtnRectangle, Color.FromArgb(50, 50, 50), Color.FromArgb(40, 40, 40), 90S)
  1154.         G.FillRectangle(bgGrad, radioBtnRectangle)
  1155.         G.DrawRectangle(New Pen(Color.FromArgb(20, 20, 20)), radioBtnRectangle)
  1156.         G.DrawRectangle(New Pen(Color.FromArgb(55, 55, 55)), New Rectangle(1, 1, Height - 3, Height - 3))
  1157.  
  1158.         If Checked Then
  1159.             Dim fillGradient As New LinearGradientBrush(InnerRect, _accentColor, Color.FromArgb(_accentColor.R + 5, _accentColor.G + 5, _accentColor.B + 5), 90S)
  1160.             G.FillRectangle(fillGradient, InnerRect)
  1161.             G.DrawRectangle(New Pen(Color.FromArgb(25, 25, 25)), InnerRect)
  1162.         End If
  1163.  
  1164.         Dim drawFont As New Font("Tahoma", 10, FontStyle.Bold)
  1165.         Dim nb As Brush = New SolidBrush(Color.FromArgb(200, 200, 200))
  1166.         G.DrawString(Text, drawFont, nb, New Point(28, 12), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center})
  1167.  
  1168.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  1169.         G.Dispose() : B.Dispose()
  1170.  
  1171.     End Sub
  1172.  
  1173. End Class
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top