Advertisement
netrosly

Clay Theme

Dec 29th, 2014
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 81.93 KB | None | 0 0
  1. Imports System.Drawing.Drawing2D
  2. Imports System.ComponentModel
  3.  
  4. #Region "Reqution Theme"
  5. Public Class MainContainer
  6.     Inherits ContainerControl
  7.  
  8. #Region "Modules & Functions"
  9.     Public Sub DrawRoundRect(g As Graphics, p As Pen, x As Single, y As Single, width As Single, height As Single, _
  10.       radius As Single)
  11.         Dim gp As New GraphicsPath()
  12.  
  13.         gp.AddLine(x + radius, y, x + width - (radius * 2), y)
  14.         ' Line
  15.         gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90)
  16.         ' Corner
  17.         gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2))
  18.         ' Line
  19.         gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, radius * 2, 0, 90)
  20.         ' Corner
  21.         gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height)
  22.         ' Line
  23.         gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90)
  24.         ' Corner
  25.         gp.AddLine(x, y + height - (radius * 2), x, y + radius)
  26.         ' Line
  27.         gp.AddArc(x, y, radius * 2, radius * 2, 180, 90)
  28.         ' Corner
  29.         gp.CloseFigure()
  30.  
  31.         g.DrawPath(p, gp)
  32.         gp.Dispose()
  33.     End Sub
  34.     Public Sub FillRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  35.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  36.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
  37.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  38.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  39.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  40.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  41.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  42.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  43.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  44.         g.SmoothingMode = mode
  45.     End Sub
  46.     Public Sub FillNotTopRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  47.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  48.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
  49.         g.FillPie(b, r.X, r.Y, 1, 1, 180, 90)
  50.         g.FillPie(b, r.X + r.Width - d, r.Y, 1, 1, 270, 90)
  51.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  52.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  53.         ' g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  54.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  55.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  56.         g.SmoothingMode = mode
  57.     End Sub
  58.     Public Sub FillNotBottomRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  59.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  60.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
  61.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  62.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  63.         'g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  64.         '  g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  65.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  66.         ' g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  67.         '   g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  68.         g.SmoothingMode = mode
  69.     End Sub
  70. #End Region
  71.     Sub New()
  72.         Me.Dock = DockStyle.Fill
  73.         Me.DoubleBuffered = True
  74.         Padding = New Padding(1, 25, 0, 51)
  75.     End Sub
  76. #Region "Paint"
  77.     Private Sub MainContainer_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  78.         e.Graphics.Clear(Color.Black)
  79.         'Top Bar
  80.         FillNotBottomRoundedRectangle(e.Graphics, New Rectangle(0, 0, Me.Width, 20), 28, New SolidBrush(Color.FromArgb(22, 28, 40)))
  81.  
  82.         e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(22, 28, 40)), New Rectangle(14, 1, 2, 18))
  83.         e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(22, 28, 40)), New Rectangle(Me.Width - 15, 1, 2, 18))
  84.         e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(22, 28, 40)), New Rectangle(1, 14, Me.Width - 1, 10))
  85.         e.Graphics.DrawString(FindForm.Text, Font, Brushes.White, New Rectangle(0, 5, Me.Width, 20), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  86.         'Bottom
  87.         FillNotTopRoundedRectangle(e.Graphics, New Rectangle(0, Me.Height - 65, Me.Width, 65), 28, New SolidBrush(Color.FromArgb(45, 57, 96)))
  88.         e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(45, 57, 96)), New Rectangle(14, Me.Height - 25, 2, 25))
  89.         e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(45, 57, 96)), New Rectangle(Me.Width - 15, Me.Height - 25, 2, 25))
  90.         e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(45, 57, 96)), New Rectangle(1, Me.Height - 14, Me.Width - 1, 2))
  91.         '  e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(45, 57, 96)), New Rectangle(0, Me.Height - 120, Me.Width, 25))
  92.         'Filler
  93.         Dim rect = New Rectangle(1, 24, Me.Width - 1, Me.Height - 75)
  94.         Dim gradbrush = New LinearGradientBrush(rect, Color.FromArgb(47, 57, 100), Color.FromArgb(26, 31, 45), 120.0!)
  95.         e.Graphics.FillRectangle(gradbrush, rect)
  96.  
  97.     End Sub
  98. #End Region
  99. #Region "ThemeDraggable"
  100.  
  101.     Private savePoint As New Point(0, 0)
  102.     Private isDragging As Boolean = False
  103.  
  104.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  105.         Dim dragRect As New Rectangle(0, 0, Me.Width, 48)
  106.         If dragRect.Contains(New Point(e.X, e.Y)) Then
  107.             isDragging = True
  108.             savePoint = New Point(e.X, e.Y)
  109.         End If
  110.         '
  111.         MyBase.OnMouseDown(e)
  112.     End Sub
  113.  
  114.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  115.         isDragging = False
  116.         MyBase.OnMouseUp(e)
  117.     End Sub
  118.  
  119.     Private mouseX As Integer
  120.     Private mouseY As Integer
  121.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  122.  
  123.         mouseX = e.X
  124.         mouseY = e.Y
  125.         If isDragging Then
  126.             Dim screenPoint As Point = PointToScreen(e.Location)
  127.             FindForm().Location = New Point(screenPoint.X - Me.savePoint.X, screenPoint.Y - Me.savePoint.Y)
  128.         End If
  129.         MyBase.OnMouseMove(e)
  130.         Invalidate()
  131.     End Sub
  132.  
  133. #End Region
  134. End Class
  135. <DefaultEvent("Scroll")> _
  136. Class CustomScrollBar
  137.     Inherits Control
  138.     'Made by the awesome and great AeonHack
  139.     Event Scroll(ByVal sender As Object)
  140.     Public Sub FillRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  141.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  142.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
  143.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  144.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  145.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  146.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  147.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  148.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  149.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  150.         g.SmoothingMode = mode
  151.     End Sub
  152.     Private _Minimum As Integer
  153.     Property Minimum() As Integer
  154.         Get
  155.             Return _Minimum
  156.         End Get
  157.         Set(ByVal value As Integer)
  158.             If value < 0 Then
  159.                 Throw New Exception("Property value is not valid.")
  160.             End If
  161.  
  162.             _Minimum = value
  163.             If value > _Value Then _Value = value
  164.             If value > _Maximum Then _Maximum = value
  165.  
  166.             InvalidateLayout()
  167.         End Set
  168.     End Property
  169.  
  170.     Private _Maximum As Integer = 100
  171.     Property Maximum() As Integer
  172.         Get
  173.             Return _Maximum
  174.         End Get
  175.         Set(ByVal value As Integer)
  176.             If value < 1 Then value = 1
  177.  
  178.             _Maximum = value
  179.             If value < _Value Then _Value = value
  180.             If value < _Minimum Then _Minimum = value
  181.  
  182.             InvalidateLayout()
  183.         End Set
  184.     End Property
  185.  
  186.     Private _Value As Integer
  187.     Property Value() As Integer
  188.         Get
  189.             If Not ShowThumb Then Return _Minimum
  190.             Return _Value
  191.         End Get
  192.         Set(ByVal value As Integer)
  193.             If value = _Value Then Return
  194.  
  195.             If value > _Maximum OrElse value < _Minimum Then
  196.                 Throw New Exception("Property value is not valid.")
  197.             End If
  198.  
  199.             _Value = value
  200.             InvalidatePosition()
  201.  
  202.             RaiseEvent Scroll(Me)
  203.         End Set
  204.     End Property
  205.  
  206.     Property _Percent As Double
  207.     Public ReadOnly Property Percent As Double
  208.         Get
  209.             If Not ShowThumb Then Return 0
  210.             Return GetProgress()
  211.         End Get
  212.     End Property
  213.  
  214.     Private _SmallChange As Integer = 1
  215.     Public Property SmallChange() As Integer
  216.         Get
  217.             Return _SmallChange
  218.         End Get
  219.         Set(ByVal value As Integer)
  220.             If value < 1 Then
  221.                 Throw New Exception("Property value is not valid.")
  222.             End If
  223.  
  224.             _SmallChange = value
  225.         End Set
  226.     End Property
  227.  
  228.     Private _LargeChange As Integer = 10
  229.     Public Property LargeChange() As Integer
  230.         Get
  231.             Return _LargeChange
  232.         End Get
  233.         Set(ByVal value As Integer)
  234.             If value < 1 Then
  235.                 Throw New Exception("Property value is not valid.")
  236.             End If
  237.  
  238.             _LargeChange = value
  239.         End Set
  240.     End Property
  241.  
  242.     Private ButtonSize As Integer = 16
  243.     Private ThumbSize As Integer = 24 ' 14 minimum
  244.  
  245.     Private TSA As Rectangle
  246.     Private BSA As Rectangle
  247.     Private Shaft As Rectangle
  248.     Private Thumb As Rectangle
  249.  
  250.     Private ShowThumb As Boolean
  251.     Private ThumbDown As Boolean
  252.  
  253.     Sub New()
  254.         SetStyle(DirectCast(139286, ControlStyles), True)
  255.         SetStyle(ControlStyles.Selectable, False)
  256.  
  257.         Width = 18
  258.  
  259.         B1 = New SolidBrush(Color.FromArgb(27, 132, 188))
  260.         B2 = New SolidBrush(Color.FromArgb(33, 159, 225))
  261.  
  262.         P1 = New Pen(Color.FromArgb(235, 235, 235))
  263.         P2 = New Pen(Color.FromArgb(165, 165, 165))
  264.         P3 = New Pen(Color.FromArgb(155, 155, 155))
  265.         P4 = New Pen(Color.FromArgb(140, 140, 40))
  266.     End Sub
  267.  
  268.     Private GP1, GP2, GP3, GP4 As GraphicsPath
  269.  
  270.     Private P1, P2, P3, P4 As Pen
  271.     Private B1, B2 As SolidBrush
  272.  
  273.     Dim I1 As Integer
  274.  
  275.     Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
  276.         Dim g As Graphics = e.Graphics
  277.         g.Clear(Color.FromArgb(28, 32, 49))
  278.  
  279.         GP1 = DrawArrow(2, 6, False)
  280.         GP2 = DrawArrow(3, 7, False)
  281.  
  282.         'g.FillPath(B1, GP2)
  283.         'g.FillPath(B2, GP1)
  284.  
  285.         GP3 = DrawArrow(2, Height - 11, True)
  286.         GP4 = DrawArrow(3, Height - 10, True)
  287.  
  288.         'g.FillPath(B1, GP4)
  289.         'g.FillPath(B2, GP3)
  290.  
  291.         If ShowThumb Then
  292.             '   g.FillRectangle(B1, Thumb)
  293.             FillRoundedRectangle(g, Thumb, 8, New SolidBrush(Color.FromArgb(72, 141, 188)))
  294.             e.Graphics.DrawLine(New Pen(Color.FromArgb(72, 141, 188)), New Point(Thumb.X + 1, Thumb.Y + 4), New Point(Thumb.Width, Thumb.Y + 4))
  295.             e.Graphics.DrawLine(New Pen(Color.FromArgb(72, 141, 188)), New Point(Thumb.X + 1, Thumb.Y + Thumb.Height - 4), New Point(Thumb.Width, Thumb.Y + Thumb.Height - 4))
  296.             'Top Y down lines
  297.             e.Graphics.DrawLine(New Pen(Color.FromArgb(72, 141, 188)), New Point(Thumb.X + 4, Thumb.Y + 1), New Point(Thumb.X + 4, Thumb.Y + 3))
  298.             e.Graphics.DrawLine(New Pen(Color.FromArgb(72, 141, 188)), New Point(Thumb.X + Thumb.Width - 4, Thumb.Y + 1), New Point(Thumb.X + Thumb.Width - 4, Thumb.Y + 3))
  299.             'Bottom Y down Lines
  300.             e.Graphics.DrawLine(New Pen(Color.FromArgb(72, 141, 188)), New Point(Thumb.X + 4, Thumb.Y + Thumb.Height - 4), New Point(Thumb.X + 4, Thumb.Y + Thumb.Height - 1))
  301.             e.Graphics.DrawLine(New Pen(Color.FromArgb(72, 141, 188)), New Point(Thumb.X + Thumb.Width - 4, Thumb.Y + Thumb.Height - 4), New Point(Thumb.X + Thumb.Width - 4, Thumb.Y + Thumb.Height - 1))
  302.             ' g.DrawRectangle(P1, Thumb)
  303.             '  g.DrawRectangle(P2, Thumb.X + 1, Thumb.Y + 1, Thumb.Width - 2, Thumb.Height - 2)
  304.  
  305.             Dim Y As Integer
  306.             Dim LY As Integer = Thumb.Y + (Thumb.Height \ 2) - 3
  307.  
  308.             For I As Integer = 0 To 2
  309.                 Y = LY + (I * 3)
  310.  
  311.                 ' g.DrawLine(P1, Thumb.X + 5, Y, Thumb.Right - 5, Y)
  312.                 ' g.DrawLine(P2, Thumb.X + 5, Y + 1, Thumb.Right - 5, Y + 1)
  313.             Next
  314.         End If
  315.  
  316.         '   g.DrawRectangle(P3, 0, 0, Width - 1, Height - 1)
  317.         '  G.DrawRectangle(P4, 1, 1, Width - 3, Height - 3)
  318.     End Sub
  319.  
  320.     Private Function DrawArrow(x As Integer, y As Integer, flip As Boolean) As GraphicsPath
  321.         Dim GP As New GraphicsPath()
  322.  
  323.         Dim W As Integer = 4
  324.         Dim H As Integer = 5
  325.  
  326.         If flip Then
  327.             GP.AddLine(x + 1, y, x + W + 1, y)
  328.             GP.AddLine(x + W, y, x + H, y + H - 1)
  329.         Else
  330.             GP.AddLine(x, y + H, x + W, y + H)
  331.             GP.AddLine(x + W, y + H, x + H, y)
  332.         End If
  333.  
  334.         GP.CloseFigure()
  335.         Return GP
  336.     End Function
  337.  
  338.     Protected Overrides Sub OnSizeChanged(e As EventArgs)
  339.         InvalidateLayout()
  340.     End Sub
  341.  
  342.     Private Sub InvalidateLayout()
  343.         TSA = New Rectangle(0, 0, Width, ButtonSize)
  344.         BSA = New Rectangle(0, Height - ButtonSize, Width, ButtonSize)
  345.         Shaft = New Rectangle(0, TSA.Bottom + 1, Width, Height - (ButtonSize * 2) - 1)
  346.  
  347.         ShowThumb = ((_Maximum - _Minimum) > Shaft.Height)
  348.  
  349.         If ShowThumb Then
  350.             'ThumbSize = Math.Max(0, 14) 'TODO: Implement this
  351.  
  352.             Thumb = New Rectangle(1, 0, Width - 8, ThumbSize)
  353.         End If
  354.  
  355.         RaiseEvent Scroll(Me)
  356.         InvalidatePosition()
  357.     End Sub
  358.  
  359.     Private Sub InvalidatePosition()
  360.         Thumb.Y = CInt(GetProgress() * (Shaft.Height - ThumbSize)) + TSA.Height
  361.         Invalidate()
  362.     End Sub
  363.  
  364.     Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  365.         If e.Button = Windows.Forms.MouseButtons.Left AndAlso ShowThumb Then
  366.             If TSA.Contains(e.Location) Then
  367.                 I1 = _Value - _SmallChange
  368.             ElseIf BSA.Contains(e.Location) Then
  369.                 I1 = _Value + _SmallChange
  370.             Else
  371.                 If Thumb.Contains(e.Location) Then
  372.                     ThumbDown = True
  373.                     MyBase.OnMouseDown(e)
  374.                     Return
  375.                 Else
  376.                     If e.Y < Thumb.Y Then
  377.                         I1 = _Value - _LargeChange
  378.                     Else
  379.                         I1 = _Value + _LargeChange
  380.                     End If
  381.                 End If
  382.             End If
  383.  
  384.             Value = Math.Min(Math.Max(I1, _Minimum), _Maximum)
  385.             InvalidatePosition()
  386.         End If
  387.  
  388.         MyBase.OnMouseDown(e)
  389.     End Sub
  390.  
  391.     Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
  392.         If ThumbDown AndAlso ShowThumb Then
  393.             Dim ThumbPosition As Integer = e.Y - TSA.Height - (ThumbSize \ 2)
  394.             Dim ThumbBounds As Integer = Shaft.Height - ThumbSize
  395.  
  396.             I1 = CInt((ThumbPosition / ThumbBounds) * (_Maximum - _Minimum)) + _Minimum
  397.  
  398.             Value = Math.Min(Math.Max(I1, _Minimum), _Maximum)
  399.             InvalidatePosition()
  400.         End If
  401.  
  402.         MyBase.OnMouseMove(e)
  403.     End Sub
  404.  
  405.     Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs)
  406.         ThumbDown = False
  407.         MyBase.OnMouseUp(e)
  408.     End Sub
  409.  
  410.     Private Function GetProgress() As Double
  411.         Return (_Value - _Minimum) / (_Maximum - _Minimum)
  412.     End Function
  413.  
  414. End Class
  415. Public Class CustomTabControl
  416.     Inherits TabControl
  417.  
  418.     Private BC As Color = Color.FromArgb(47, 57, 100) 'Background Color
  419.     Private SLGT As Color = Color.FromArgb(47, 57, 100) 'Selected Tab Gradient Color Top
  420.     Private SLGB As Color = Color.FromArgb(200, 200, 200) 'Selected Tab Gradient Color Bottom
  421.     Private SLLT As Pen = New Pen(Color.FromArgb(165, 165, 165)) 'Selected Tab Line Color Top
  422.     Private SLLB As Pen = New Pen(Color.FromArgb(98, 98, 98)) 'Selected Tab Line Color Bottom
  423.     Private TC As SolidBrush = New SolidBrush(Color.FromArgb(180, 180, 180)) 'Header Text Color
  424.     Private UTC As Brush = Brushes.White 'Unselected Tab Font Color
  425.     Private STC As Brush = New SolidBrush(Color.FromArgb(67, 129, 172)) 'Selected Tab Font Color
  426.  
  427.     Private BCB As SolidBrush = New SolidBrush(BC)
  428.     Private BCP As Pen = New Pen(BC)
  429.     Private TR, InTR, InR, LR, ImR As Rectangle
  430.     Private SF As StringFormat = New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center}
  431.     Private SFHeader As StringFormat = New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Far}
  432.     Private ICounter As Integer = 0
  433.     Private SLGBr As LinearGradientBrush
  434.     Private TSB As SolidBrush
  435.     Private TROffset As Integer = 1
  436.  
  437.     Sub New()
  438.         SetStyle(ControlStyles.UserPaint Or ControlStyles.Opaque Or ControlStyles.ResizeRedraw Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.Opaque, True)
  439.         SetStyle(ControlStyles.Selectable, False)
  440.         SizeMode = TabSizeMode.Fixed
  441.         Alignment = TabAlignment.Left
  442.         ItemSize = New Size(21, 180)
  443.         DrawMode = TabDrawMode.OwnerDrawFixed
  444.         Font = New Font("Verdana", 8)
  445.     End Sub
  446.  
  447.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  448.         MyBase.OnPaint(e)
  449.         Dim g As Graphics = e.Graphics
  450.         Dim rect = New Rectangle(1, 24, Me.Width - 1, Me.Height - 55)
  451.         Dim gradbrush = New LinearGradientBrush(rect, Color.FromArgb(47, 57, 100), Color.FromArgb(26, 31, 45), 120.0!)
  452.         If Not SelectedIndex = Nothing AndAlso Not SelectedIndex = -1 AndAlso Not SelectedIndex > TabPages.Count - 1 AndAlso Not TabPages(SelectedIndex).BackColor = Color.Transparent Then
  453.             g.Clear(Color.FromArgb(47, 57, 100))
  454.         Else
  455.             g.Clear(Color.FromArgb(47, 57, 100))
  456.         End If
  457.         ICounter = 0
  458.  
  459.         LR = New Rectangle(0, 0, ItemSize.Height + 3, Height)
  460.         gradbrush = New LinearGradientBrush(LR, Color.FromArgb(47, 57, 100), Color.FromArgb(26, 31, 45), 120.0!)
  461.         g.FillRectangle(gradbrush, LR)
  462.         'g.DrawRectangle(BCP, LR)
  463.  
  464.         g.SmoothingMode = SmoothingMode.AntiAlias
  465.         For i = 0 To TabCount - 1
  466.             TR = GetTabRect(i)
  467.             TR = New Rectangle(TR.X, TR.Y, TR.Width - 1, TR.Height)
  468.             If TabPages(i).Tag IsNot Nothing AndAlso TabPages(i).Tag IsNot String.Empty Then
  469.                 InR = New Rectangle(TR.X + 10, TR.Y, TR.Width - 10, TR.Height)
  470.                 g.DrawString(TabPages(i).Text.ToUpper, New Font("Myriad Pro", 10, FontStyle.Regular), TC, InR, SFHeader)
  471.                 ICounter += 1
  472.             Else
  473.                 If i = SelectedIndex Then
  474.                     SLGBr = New LinearGradientBrush(TR, SLGT, SLGB, 90)
  475.                     InR = New Rectangle(TR.X + 36, TR.Y, TR.Width - 36, TR.Height)
  476.                     InTR = New Rectangle(TR.X, TR.Y + TROffset, TR.Width, TR.Height - (2 * TROffset))
  477.  
  478.                     ' g.FillRectangle(SLGBr, InTR)
  479.                     'g.DrawLine(SLLT, TR.X, TR.Y + TROffset, TR.X + TR.Width - 1, TR.Y + TROffset)
  480.                     '  g.DrawLine(SLLB, TR.X, TR.Y + TR.Height - TROffset, TR.X + TR.Width - 1, TR.Y + TR.Height - TROffset)
  481.                     g.DrawString(TabPages(i).Text, New Font("Myriad Pro", 10, FontStyle.Regular), STC, InR, SF)
  482.  
  483.                     If SelectedImageList IsNot Nothing AndAlso SelectedImageList.Images.Count > i - ICounter AndAlso SelectedImageList.Images(i - ICounter) IsNot Nothing Then
  484.                         ImR = New Rectangle(TR.X + 13, TR.Y + ((TR.Height / 2) - 8), 16, 16)
  485.                         g.DrawImage(SelectedImageList.Images(i - ICounter), ImR)
  486.                     End If
  487.  
  488.                 Else
  489.                     InR = New Rectangle(TR.X + 36, TR.Y, TR.Width - 36, TR.Height)
  490.                     g.DrawString(TabPages(i).Text, Font, UTC, InR, SF)
  491.  
  492.                     If UnselectedImageList IsNot Nothing AndAlso UnselectedImageList.Images.Count > i - ICounter AndAlso UnselectedImageList.Images(i - ICounter) IsNot Nothing Then
  493.                         ImR = New Rectangle(TR.X + 13, TR.Y + ((TR.Height / 2) - 8), 16, 16)
  494.                         g.DrawImage(UnselectedImageList.Images(i - ICounter), ImR)
  495.                     End If
  496.  
  497.                 End If
  498.             End If
  499.         Next
  500.  
  501.  
  502.         g.Dispose()
  503.  
  504.     End Sub
  505.  
  506.     Private UnselectedImageList As ImageList
  507.     Public Property ImageList_Unselected As ImageList
  508.         Get
  509.             Return UnselectedImageList
  510.         End Get
  511.         Set(value As ImageList)
  512.             UnselectedImageList = value
  513.             If UnselectedImageList IsNot Nothing AndAlso Not UnselectedImageList.ImageSize = New Size(16, 16) Then
  514.                 UnselectedImageList.ImageSize = New Size(16, 16)
  515.             End If
  516.             Invalidate()
  517.         End Set
  518.     End Property
  519.  
  520.     Private SelectedImageList As ImageList
  521.     Public Property ImageList_Selected As ImageList
  522.         Get
  523.             Return SelectedImageList
  524.         End Get
  525.         Set(value As ImageList)
  526.             SelectedImageList = value
  527.             If SelectedImageList IsNot Nothing AndAlso Not SelectedImageList.ImageSize = New Size(16, 16) Then
  528.                 SelectedImageList.ImageSize = New Size(16, 16)
  529.             End If
  530.             Invalidate()
  531.         End Set
  532.     End Property
  533.  
  534.     Protected Overrides Sub OnSelecting(e As TabControlCancelEventArgs)
  535.         MyBase.OnSelecting(e)
  536.         If e.TabPage IsNot Nothing AndAlso e.TabPage.Tag IsNot Nothing AndAlso e.TabPage.Tag IsNot String.Empty AndAlso Not DesignMode Then
  537.             e.Cancel = True
  538.         End If
  539.     End Sub
  540.  
  541. End Class
  542. Public Class BackgroundContainer
  543.     Inherits Control
  544.     Sub New()
  545.         Me.DoubleBuffered = True
  546.     End Sub
  547. #Region "Paint"
  548.  
  549. #End Region
  550.  
  551.     Private Sub BackgroundContainer_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  552.         Dim rect = New Rectangle(0, 0, Me.Width, Me.Height)
  553.         Dim gradbrush = New LinearGradientBrush(rect, Color.FromArgb(47, 57, 100), Color.FromArgb(26, 31, 45), 120.0!)
  554.         e.Graphics.FillRectangle(gradbrush, rect)
  555.     End Sub
  556.  
  557.     Private Sub BackgroundContainer_Resize(sender As Object, e As EventArgs) Handles Me.Resize
  558.         Me.Refresh()
  559.     End Sub
  560. End Class
  561. Public Class PlayListControl
  562.     Inherits ContainerControl
  563.     Property Image As Image
  564.     Event Clicked()
  565.     Property Texxt As String = "PLAYLIST"
  566.     Sub New()
  567.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  568.            ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  569.            ControlStyles.SupportsTransparentBackColor, True)
  570.         DoubleBuffered = True
  571.         BackColor = Color.Transparent
  572.         Parent = FindForm()
  573.         Me.Padding = New Padding(0, 30, 0, 0)
  574.     End Sub
  575. #Region "Paint"
  576.     Private Sub PlayListControl_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  577.         e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(50, 67, 129, 172)), New Rectangle(0, 0, Me.Width, 30))
  578.         e.Graphics.DrawImage(Image, New Rectangle(20, 4, 24, 24))
  579.         e.Graphics.DrawString(Texxt, New Font("Myriad Pro", 10, FontStyle.Regular), Brushes.White, New Rectangle(48, 8, Me.Width, 40))
  580.         e.Graphics.DrawString("+", New Font("Myriad Pro", 16, FontStyle.Regular), Brushes.White, New Rectangle(Me.Width - 25, 4, Me.Width, 40))
  581.     End Sub
  582. #End Region
  583. #Region "ThemeDraggable"
  584.     Dim clickedd As Boolean = False
  585.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  586.         If New Rectangle(Me.Width - 25, 4, Me.Width, 40).Contains(mouseX, mouseY) Then
  587.             If e.Button = Windows.Forms.MouseButtons.Left Then
  588.                 RaiseEvent Clicked()
  589.             End If
  590.         End If
  591.         '
  592.         MyBase.OnMouseDown(e)
  593.     End Sub
  594.  
  595.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  596.  
  597.         MyBase.OnMouseUp(e)
  598.     End Sub
  599.  
  600.     Private mouseX As Integer
  601.     Private mouseY As Integer
  602.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  603.  
  604.         mouseX = e.X
  605.         mouseY = e.Y
  606.         If New Rectangle(2, 2, Me.Width - 4, Me.Height - 4).Contains(mouseX, mouseY) Then
  607.             Cursor = Cursors.Hand
  608.         Else
  609.             Cursor = Cursors.Arrow
  610.         End If
  611.         MyBase.OnMouseMove(e)
  612.         Invalidate()
  613.     End Sub
  614.  
  615. #End Region
  616. End Class
  617. Partial Public Class PlayListbox
  618.     Inherits Control
  619.     Public Event SelectedItem(i As Integer)
  620.     Property OutBorderColor As Color = Color.FromArgb(229, 229, 229)
  621.     Property InBorderColor As Color = Color.FromArgb(219, 219, 219)
  622.     Property BoxColor As Color = Color.FromArgb(242, 242, 242)
  623.     Property OddColor As Color = Color.FromArgb(88, 159, 214)
  624.     Property PopOddColor As Color = Color.FromArgb(28, 32, 49)
  625.     Private VS As CustomScrollBar
  626.     Protected Overrides Sub OnSizeChanged(e As EventArgs)
  627.         InvalidateLayout()
  628.         MyBase.OnSizeChanged(e)
  629.     End Sub
  630.  
  631.     Private Sub HandleScroll(sender As Object)
  632.         Invalidate()
  633.     End Sub
  634.  
  635.     Private Sub InvalidateScroll()
  636.         VS.Maximum = (_Items.Count * 24)
  637.         Invalidate()
  638.     End Sub
  639.  
  640.     Private Sub InvalidateLayout()
  641.         VS.Location = New Point(Width - VS.Width + 2, 1)
  642.         VS.Size = New Size(18, Height - 2)
  643.  
  644.         Invalidate()
  645.     End Sub
  646.     Sub New()
  647.         SetStyle(DirectCast(139286, ControlStyles), True)
  648.         SetStyle(ControlStyles.Selectable, True)
  649.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  650.            ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  651.            ControlStyles.SupportsTransparentBackColor, True)
  652.         DoubleBuffered = True
  653.         BackColor = Color.Transparent
  654.         Parent = FindForm()
  655.  
  656.  
  657.         VS = New CustomScrollBar
  658.         VS.SmallChange = 24
  659.         VS.LargeChange = 24
  660.         AddHandler VS.Scroll, AddressOf HandleScroll
  661.         AddHandler VS.MouseDown, AddressOf VS_MouseDown
  662.         Controls.Add(VS)
  663.  
  664.         InvalidateLayout()
  665.     End Sub
  666.     Private Sub VS_MouseDown(sender As Object, e As MouseEventArgs)
  667.         Focus()
  668.         Dim Offset As Integer = CInt(VS.Percent * (VS.Maximum - (Height - (24 * 2))))
  669.         Dim Index As Integer = ((e.Y + Offset - 24) \ 24)
  670.     End Sub
  671.     Protected Overrides Sub OnMouseWheel(e As MouseEventArgs)
  672.         Dim Move As Integer = -((e.Delta * SystemInformation.MouseWheelScrollLines \ 120) * (24 \ 2))
  673.  
  674.         Dim Value As Integer = Math.Max(Math.Min(VS.Value + Move, VS.Maximum), VS.Minimum)
  675.         VS.Value = Value
  676.  
  677.         MyBase.OnMouseWheel(e)
  678.     End Sub
  679.     Public Class ItemCollection
  680.         Inherits List(Of Item)
  681.         Private Parent As PlayListbox
  682.         Public Sub New(Parent As PlayListbox)
  683.             Me.Parent = Parent
  684.  
  685.         End Sub
  686.         Public Shadows Sub Add(Item As Item)
  687.             MyBase.Add(Item)
  688.             Parent.InvalidateScroll()
  689.         End Sub
  690.         Public Shadows Sub AddRange(Range As List(Of Item))
  691.             MyBase.AddRange(Range)
  692.             Parent.InvalidateScroll()
  693.         End Sub
  694.         Public Shadows Sub Clear()
  695.             MyBase.Clear()
  696.             Parent.InvalidateScroll()
  697.         End Sub
  698.         Public Shadows Sub Remove(Item As Item)
  699.             MyBase.Remove(Item)
  700.             Parent.InvalidateScroll()
  701.         End Sub
  702.         Public Shadows Sub RemoveAt(Index As Integer)
  703.             MyBase.RemoveAt(Index)
  704.             Parent.InvalidateScroll()
  705.         End Sub
  706.         Public Shadows Sub RemoveAll(Predicate As System.Predicate(Of Item))
  707.             MyBase.RemoveAll(Predicate)
  708.             Parent.InvalidateScroll()
  709.         End Sub
  710.         Public Shadows Sub RemoveRange(Index As Integer, Count As Integer)
  711.             MyBase.RemoveRange(Index, Count)
  712.             Parent.InvalidateScroll()
  713.         End Sub
  714.  
  715.     End Class
  716.     Public Class Item
  717.         Property Text As String
  718.         Property OddColor As Color = Color.FromArgb(37, 142, 198)
  719.         Property PopOddColor As Color = Color.FromArgb(17, 122, 178)
  720.         Property Index As Integer = 0
  721.         Property locy As Integer = 0
  722.         Property Image As Image = My.Resources.Screenshot_3
  723.         Property Selected As Boolean = False
  724.         Protected UniqueId As Guid
  725.         Sub New()
  726.             UniqueId = Guid.NewGuid()
  727.         End Sub
  728.         Public Overrides Function ToString() As String
  729.             Return Text
  730.         End Function
  731.  
  732.         Public Overrides Function Equals(obj As Object) As Boolean
  733.             If TypeOf obj Is Item Then
  734.                 Return (DirectCast(obj, Item).UniqueId = UniqueId)
  735.             End If
  736.             Return False
  737.         End Function
  738.  
  739.     End Class
  740.     Public _Items As New ItemCollection(Me)
  741.     <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
  742.     Public Property Items As ItemCollection
  743.         Get
  744.             Return _Items
  745.         End Get
  746.         Set(ByVal value As ItemCollection)
  747.             _Items = value
  748.         End Set
  749.     End Property
  750.  
  751.     Private Sub FlatListbox_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  752.         Dim Offset As Integer = CInt(VS.Percent * (VS.Maximum - (Height - (24 * 2))))
  753.         Dim rect2 = New Rectangle(0, 0, Me.Width, Me.Height)
  754.         Dim gradbrush = New LinearGradientBrush(rect2, Color.FromArgb(47, 57, 100), Color.FromArgb(26, 31, 45), 120.0!)
  755.         ' e.Graphics.Clear(BoxColor)
  756.         '   e.Graphics.DrawRectangle(New Pen(InBorderColor), New Rectangle(1, 1, Me.Width - 3, Me.Height - 3))
  757.         ' e.Graphics.DrawRectangle(New Pen(OutBorderColor), New Rectangle(0, 0, Me.Width - 2, Me.Height - 2))
  758.         e.Graphics.FillRectangle(gradbrush, rect2)
  759.         VS.Width = 16
  760.         VS.Height = Me.Height + 32
  761.         VS.Location = New Point(Me.Width - 10, -16)
  762.         Dim y As Integer = 4
  763.         For Each Item As Item In _Items
  764.  
  765.             y = 24 * Item.Index
  766.             If Not Item.Selected = True Then
  767.                 Item.locy = y
  768.                 Dim rect = New Rectangle(0, y - Offset, Me.Width - 4, 24)
  769.                 e.Graphics.FillRectangle(New SolidBrush(Color.Transparent), rect)
  770.                 rect = New Rectangle(0, y + 20 - Offset, Me.Width - 4, 4)
  771.                 e.Graphics.FillRectangle(New SolidBrush(Color.Transparent), rect)
  772.                 e.Graphics.DrawString(Item.Text, New Font("Myriad Pro", 9.5, FontStyle.Regular), New SolidBrush(Color.FromArgb(230, 230, 230)), 24, y + 4 - Offset)
  773.                 e.Graphics.DrawImage(Item.Image, New Rectangle(6, y + 6 - Offset, 16, 16))
  774.             Else
  775.                 Dim rect = New Rectangle(0, y - Offset, Me.Width, 24)
  776.                 e.Graphics.FillRectangle(New SolidBrush(OddColor), rect)
  777.                 rect = New Rectangle(0, y - Offset, 3, 24)
  778.                 e.Graphics.FillRectangle(New SolidBrush(PopOddColor), rect)
  779.                 e.Graphics.DrawString(Item.Text, New Font("Myriad Pro", 9.5, FontStyle.Regular), New SolidBrush(Color.White), 24, y + 4 - Offset)
  780.                 e.Graphics.DrawImage(Item.Image, New Rectangle(6, y + 6 - Offset, 16, 16))
  781.             End If
  782.         Next
  783.     End Sub
  784.     'Example
  785.     Public Function SelectedItemIndex()
  786.         For Each Item As Item In _Items
  787.             If Item.Selected = True Then
  788.                 Return Item.Index
  789.             End If
  790.         Next
  791.     End Function
  792. #Region "ThemeDraggable"
  793.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  794.         Dim y As Integer = 3
  795.         Dim Offset As Integer = CInt(VS.Percent * (VS.Maximum - (Height - (24 * 2))))
  796.         For Each Item As Item In _Items
  797.             y = 24 * Item.Index
  798.             Dim rect = New Rectangle(2, y - Offset, Me.Width - 4, 24)
  799.             If Item.locy = y Then
  800.                 If rect.Contains(mouseX, mouseY) Then
  801.                     Item.Selected = Not Item.Selected
  802.                     RaiseEvent SelectedItem(Item.Index)
  803.                 Else
  804.                     Item.Selected = False
  805.                 End If
  806.             Else
  807.                 Item.Selected = False
  808.             End If
  809.         Next
  810.         '
  811.  
  812.         MyBase.OnMouseDown(e)
  813.     End Sub
  814.  
  815.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  816.  
  817.         MyBase.OnMouseUp(e)
  818.     End Sub
  819.  
  820.     Private mouseX As Integer
  821.     Private mouseY As Integer
  822.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  823.  
  824.         mouseX = e.X
  825.         mouseY = e.Y
  826.  
  827.         MyBase.OnMouseMove(e)
  828.         Invalidate()
  829.     End Sub
  830.  
  831. #End Region
  832. End Class
  833. Public Class Texxtbox
  834.     Inherits Panel
  835. #Region "Modules & Functions"
  836.     Public Sub DrawRoundRect(g As Graphics, p As Pen, x As Single, y As Single, width As Single, height As Single, _
  837.        radius As Single)
  838.         Dim gp As New GraphicsPath()
  839.  
  840.         gp.AddLine(x + radius, y, x + width - (radius * 2), y)
  841.         ' Line
  842.         gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90)
  843.         ' Corner
  844.         gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2))
  845.         ' Line
  846.         gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, radius * 2, 0, 90)
  847.         ' Corner
  848.         gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height)
  849.         ' Line
  850.         gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90)
  851.         ' Corner
  852.         gp.AddLine(x, y + height - (radius * 2), x, y + radius)
  853.         ' Line
  854.         gp.AddArc(x, y, radius * 2, radius * 2, 180, 90)
  855.         ' Corner
  856.         gp.CloseFigure()
  857.  
  858.         g.DrawPath(p, gp)
  859.         gp.Dispose()
  860.     End Sub
  861.     Public Sub FillRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  862.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  863.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
  864.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  865.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  866.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  867.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  868.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  869.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  870.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  871.         g.SmoothingMode = mode
  872.     End Sub
  873.     Public Sub FillNotTopRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  874.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  875.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
  876.         g.FillPie(b, r.X, r.Y, 1, 1, 180, 90)
  877.         g.FillPie(b, r.X + r.Width - d, r.Y, 1, 1, 270, 90)
  878.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  879.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  880.         ' g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  881.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  882.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  883.         g.SmoothingMode = mode
  884.     End Sub
  885.  
  886. #End Region
  887.     Friend WithEvents TB As TextBox
  888.     Protected Overrides Sub OnCreateControl()
  889.         MyBase.OnCreateControl()
  890.         If Not Controls.Contains(TB) Then
  891.             Controls.Add(TB)
  892.         End If
  893.     End Sub
  894.     Sub New()
  895.         Me.Size = New Size(200, 30)
  896.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  897.           ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  898.           ControlStyles.SupportsTransparentBackColor, True)
  899.         DoubleBuffered = True
  900.         BackColor = Color.Transparent
  901.         Parent = FindForm()
  902.         MyBase.Font = New Font("Myriad Pro", 12, FontStyle.Regular)
  903.         TB = New Windows.Forms.TextBox
  904.         TB.Font = New Font("Segoe UI", 15)
  905.         TB.Text = Text
  906.         TB.ForeColor = _TextColour
  907.         TB.MaxLength = _MaxLength
  908.         TB.BackColor = _BaseColour
  909.         TB.Multiline = False
  910.         TB.ReadOnly = _ReadOnly
  911.         TB.UseSystemPasswordChar = _UseSystemPasswordChar
  912.         TB.BorderStyle = BorderStyle.None
  913.         TB.Location = New Point(5, 7)
  914.         TB.Width = Width - 7
  915.         TB.Font = MyBase.Font
  916.     End Sub
  917. #Region "Paint"
  918.     Private Sub Texxtbox_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  919.         e.Graphics.SmoothingMode = SmoothingMode.HighQuality
  920.         Dim rect = New Rectangle(0, 0, Me.Width, Me.Height)
  921.         Dim gradbrush = New LinearGradientBrush(rect, Color.FromArgb(44, 113, 170), Color.FromArgb(30, 107, 158), 120.0!)
  922.         FillRoundedRectangle(e.Graphics, rect, 10, gradbrush)
  923.         rect = New Rectangle(2, 2, Me.Width - 4, Me.Height - 4)
  924.         gradbrush = New LinearGradientBrush(rect, Color.FromArgb(60, 121, 181), Color.FromArgb(60, 121, 181), 120.0!)
  925.         FillRoundedRectangle(e.Graphics, rect, 10, gradbrush)
  926.         DrawRoundRect(e.Graphics, New Pen(Color.FromArgb(31, 79, 115)), 2, 2, Me.Width - 4, Me.Height - 4, 8)
  927.         'textbox
  928.         TB.Text = _Text
  929.         TB.Font = Font
  930.         TB.BackColor = _BaseColour
  931.         TB.ForeColor = _TextColour
  932.         TB.Location = New Point(5, 7)
  933.         TB.Width = Width - 40
  934.     End Sub
  935. #End Region
  936. #Region "Events - Properties"
  937.     Private _BorderColour As Color = Color.FromArgb(163, 190, 146)
  938.     Private _LineColour As Color = Color.FromArgb(221, 221, 221)
  939.     Private _TextColour As Color = Color.FromArgb(12, 46, 83)
  940.     Private _TextAlign As HorizontalAlignment = HorizontalAlignment.Left
  941.     Private _MaxLength As Integer = 32767
  942.     Private _ReadOnly As Boolean
  943.     Private _BaseColour As Color = Color.FromArgb(60, 121, 181)
  944.     Private _UseSystemPasswordChar As Boolean
  945.     Private _Text As String = "Username"
  946.     Public Sub SelectAll()
  947.         TB.Focus()
  948.         TB.SelectAll()
  949.         Invalidate()
  950.     End Sub
  951.     <Category("Username")>
  952.     Public Property BaseColour As Color
  953.         Get
  954.             Return _BaseColour
  955.         End Get
  956.         Set(value As Color)
  957.             _BaseColour = value
  958.         End Set
  959.     End Property
  960.  
  961.     <Category("Username")>
  962.     Public Property BorderColour As Color
  963.         Get
  964.             Return _BorderColour
  965.         End Get
  966.         Set(value As Color)
  967.             _BorderColour = value
  968.         End Set
  969.     End Property
  970.  
  971.     <Category("Username")>
  972.     Public Property LineColour As Color
  973.         Get
  974.             Return _LineColour
  975.         End Get
  976.         Set(value As Color)
  977.             _LineColour = value
  978.         End Set
  979.     End Property
  980.  
  981.     <Category("Username")>
  982.     Public Property TextColour As Color
  983.         Get
  984.             Return _TextColour
  985.         End Get
  986.         Set(value As Color)
  987.             _TextColour = value
  988.         End Set
  989.     End Property
  990.  
  991.  
  992.  
  993.     <Category("Username")>
  994.     Property TextAlign() As HorizontalAlignment
  995.         Get
  996.             Return _TextAlign
  997.         End Get
  998.         Set(ByVal value As HorizontalAlignment)
  999.             _TextAlign = value
  1000.             If TB IsNot Nothing Then
  1001.                 TB.TextAlign = value
  1002.             End If
  1003.         End Set
  1004.     End Property
  1005.  
  1006.     <Category("Username")>
  1007.     Property MaxLength() As Integer
  1008.         Get
  1009.             Return _MaxLength
  1010.         End Get
  1011.         Set(ByVal value As Integer)
  1012.             _MaxLength = value
  1013.             If TB IsNot Nothing Then
  1014.                 TB.MaxLength = value
  1015.             End If
  1016.         End Set
  1017.     End Property
  1018.  
  1019.     <Category("Username")>
  1020.     Property [ReadOnly]() As Boolean
  1021.         Get
  1022.             Return _ReadOnly
  1023.         End Get
  1024.         Set(ByVal value As Boolean)
  1025.             _ReadOnly = value
  1026.             If TB IsNot Nothing Then
  1027.                 TB.ReadOnly = value
  1028.             End If
  1029.         End Set
  1030.     End Property
  1031.  
  1032.     <Category("Username")>
  1033.     Property UseSystemPasswordChar() As Boolean
  1034.         Get
  1035.             Return _UseSystemPasswordChar
  1036.         End Get
  1037.         Set(ByVal value As Boolean)
  1038.             _UseSystemPasswordChar = value
  1039.             If TB IsNot Nothing Then
  1040.                 TB.UseSystemPasswordChar = value
  1041.             End If
  1042.         End Set
  1043.     End Property
  1044.     <Category("Username")>
  1045.     Property Textt As String
  1046.         Get
  1047.             Return _Text
  1048.         End Get
  1049.         Set(ByVal value As String)
  1050.             _Text = value
  1051.             If TB IsNot Nothing Then
  1052.                 TB.Text = value
  1053.             End If
  1054.         End Set
  1055.     End Property
  1056.  
  1057.  
  1058. #End Region
  1059. End Class
  1060. Public Class CustomSplitter
  1061.     Inherits Panel
  1062.     Sub New()
  1063.         Me.Size = New Size(10, 3)
  1064.  
  1065.     End Sub
  1066. #Region "paint"
  1067.     Private Sub CustomSplitter_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  1068.         e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(56, 171, 215)), New Rectangle(0, 0, Me.Width, Me.Height))
  1069.     End Sub
  1070. #End Region
  1071.  
  1072.  
  1073.     Private Sub CustomSplitter_Resize(sender As Object, e As EventArgs) Handles Me.Resize
  1074.         Me.Size = New Size(Me.Width, 3)
  1075.     End Sub
  1076. End Class
  1077. Public Class Checkbox
  1078.     Inherits Panel
  1079.     Event CheckClick()
  1080.     Property Checked As Boolean = False
  1081. #Region "Modules & Functions"
  1082.     Public Sub DrawRoundRect(g As Graphics, p As Pen, x As Single, y As Single, width As Single, height As Single, _
  1083.        radius As Single)
  1084.         Dim gp As New GraphicsPath()
  1085.  
  1086.         gp.AddLine(x + radius, y, x + width - (radius * 2), y)
  1087.         ' Line
  1088.         gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90)
  1089.         ' Corner
  1090.         gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2))
  1091.         ' Line
  1092.         gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, radius * 2, 0, 90)
  1093.         ' Corner
  1094.         gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height)
  1095.         ' Line
  1096.         gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90)
  1097.         ' Corner
  1098.         gp.AddLine(x, y + height - (radius * 2), x, y + radius)
  1099.         ' Line
  1100.         gp.AddArc(x, y, radius * 2, radius * 2, 180, 90)
  1101.         ' Corner
  1102.         gp.CloseFigure()
  1103.  
  1104.         g.DrawPath(p, gp)
  1105.         gp.Dispose()
  1106.     End Sub
  1107.     Public Sub FillRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  1108.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  1109.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
  1110.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  1111.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  1112.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  1113.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  1114.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  1115.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  1116.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  1117.         g.SmoothingMode = mode
  1118.     End Sub
  1119.     Public Sub FillNotTopRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  1120.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  1121.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
  1122.         g.FillPie(b, r.X, r.Y, 1, 1, 180, 90)
  1123.         g.FillPie(b, r.X + r.Width - d, r.Y, 1, 1, 270, 90)
  1124.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  1125.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  1126.         ' g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  1127.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  1128.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  1129.         g.SmoothingMode = mode
  1130.     End Sub
  1131.  
  1132. #End Region
  1133.     Sub New()
  1134.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  1135.    ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  1136.    ControlStyles.SupportsTransparentBackColor, True)
  1137.         DoubleBuffered = True
  1138.         BackColor = Color.Transparent
  1139.         Parent = FindForm()
  1140.         Me.Size = New Size(20, 20)
  1141.     End Sub
  1142. #Region "paint"
  1143.  
  1144.     Private Sub Checkbox_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  1145.         e.Graphics.SmoothingMode = SmoothingMode.HighQuality
  1146.         Dim rect = New Rectangle(0, 0, Me.Width, Me.Height)
  1147.         Dim gradbrush = New LinearGradientBrush(rect, Color.FromArgb(44, 113, 170), Color.FromArgb(30, 107, 158), 120.0!)
  1148.         FillRoundedRectangle(e.Graphics, rect, 2, gradbrush)
  1149.         rect = New Rectangle(2, 2, Me.Width - 4, Me.Height - 4)
  1150.         gradbrush = New LinearGradientBrush(rect, Color.FromArgb(60, 121, 181), Color.FromArgb(44, 98, 135), 120.0!)
  1151.         FillRoundedRectangle(e.Graphics, rect, 2, gradbrush)
  1152.         DrawRoundRect(e.Graphics, New Pen(Color.FromArgb(31, 79, 115)), 2, 2, Me.Width - 4, Me.Height - 4, 1)
  1153.         If Checked = False Then
  1154.  
  1155.         Else
  1156.             e.Graphics.DrawString("a", New Font("Webdings", 12, FontStyle.Regular), Brushes.White, New Rectangle(0, 0, Me.Width - 4, Me.Height - 4))
  1157.         End If
  1158.     End Sub
  1159. #End Region
  1160. #Region "ThemeDraggable"
  1161.     Dim clickedd As Boolean = False
  1162.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  1163.         If New Rectangle(2, 2, Me.Width - 4, Me.Height - 4).Contains(mouseX, mouseY) Then
  1164.             If e.Button = Windows.Forms.MouseButtons.Left Then
  1165.                 RaiseEvent CheckClick()
  1166.                 Checked = Not Checked
  1167.             End If
  1168.         End If
  1169.         '
  1170.         MyBase.OnMouseDown(e)
  1171.     End Sub
  1172.  
  1173.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  1174.  
  1175.         MyBase.OnMouseUp(e)
  1176.     End Sub
  1177.  
  1178.     Private mouseX As Integer
  1179.     Private mouseY As Integer
  1180.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  1181.  
  1182.         mouseX = e.X
  1183.         mouseY = e.Y
  1184.         If New Rectangle(2, 2, Me.Width - 4, Me.Height - 4).Contains(mouseX, mouseY) Then
  1185.             Cursor = Cursors.Hand
  1186.         Else
  1187.             Cursor = Cursors.Arrow
  1188.         End If
  1189.         MyBase.OnMouseMove(e)
  1190.         Invalidate()
  1191.     End Sub
  1192.  
  1193. #End Region
  1194. End Class
  1195. Module DesignFunctions
  1196.     Function ToBrush(ByVal A As Integer, ByVal R As Integer, ByVal G As Integer, ByVal B As Integer) As Brush
  1197.         Return ToBrush(Color.FromArgb(A, R, G, B))
  1198.     End Function
  1199.     Function ToBrush(ByVal R As Integer, ByVal G As Integer, ByVal B As Integer) As Brush
  1200.         Return ToBrush(Color.FromArgb(R, G, B))
  1201.     End Function
  1202.     Function ToBrush(ByVal A As Integer, ByVal C As Color) As Brush
  1203.         Return ToBrush(Color.FromArgb(A, C))
  1204.     End Function
  1205.     Function ToBrush(ByVal Pen As Pen) As Brush
  1206.         Return ToBrush(Pen.Color)
  1207.     End Function
  1208.     Function ToBrush(ByVal Color As Color) As Brush
  1209.         Return New SolidBrush(Color)
  1210.     End Function
  1211.     Function ToPen(ByVal A As Integer, ByVal R As Integer, ByVal G As Integer, ByVal B As Integer) As Pen
  1212.         Return ToPen(Color.FromArgb(A, R, G, B))
  1213.     End Function
  1214.     Function ToPen(ByVal R As Integer, ByVal G As Integer, ByVal B As Integer) As Pen
  1215.         Return ToPen(Color.FromArgb(R, G, B))
  1216.     End Function
  1217.     Function ToPen(ByVal A As Integer, ByVal C As Color) As Pen
  1218.         Return ToPen(Color.FromArgb(A, C))
  1219.     End Function
  1220.     Function ToPen(ByVal Color As Color) As Pen
  1221.         Return ToPen(New SolidBrush(Color))
  1222.     End Function
  1223.     Function ToPen(ByVal Brush As SolidBrush) As Pen
  1224.         Return New Pen(Brush)
  1225.     End Function
  1226.  
  1227.     Class CornerStyle
  1228.         Public TopLeft As Boolean
  1229.         Public TopRight As Boolean
  1230.         Public BottomLeft As Boolean
  1231.         Public BottomRight As Boolean
  1232.     End Class
  1233.  
  1234.     Public Function AdvRect(ByVal Rectangle As Rectangle, ByVal CornerStyle As CornerStyle, ByVal Curve As Integer) As GraphicsPath
  1235.         AdvRect = New GraphicsPath()
  1236.         Dim ArcRectangleWidth As Integer = Curve * 2
  1237.  
  1238.         If CornerStyle.TopLeft Then
  1239.             AdvRect.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  1240.         Else
  1241.             AdvRect.AddLine(Rectangle.X, Rectangle.Y, Rectangle.X + ArcRectangleWidth, Rectangle.Y)
  1242.         End If
  1243.  
  1244.         If CornerStyle.TopRight Then
  1245.             AdvRect.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  1246.         Else
  1247.             AdvRect.AddLine(Rectangle.X + Rectangle.Width, Rectangle.Y, Rectangle.X + Rectangle.Width, Rectangle.Y + ArcRectangleWidth)
  1248.         End If
  1249.  
  1250.         If CornerStyle.BottomRight Then
  1251.             AdvRect.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  1252.         Else
  1253.             AdvRect.AddLine(Rectangle.X + Rectangle.Width, Rectangle.Y + Rectangle.Height, Rectangle.X + Rectangle.Width - ArcRectangleWidth, Rectangle.Y + Rectangle.Height)
  1254.         End If
  1255.  
  1256.         If CornerStyle.BottomLeft Then
  1257.             AdvRect.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  1258.         Else
  1259.             AdvRect.AddLine(Rectangle.X, Rectangle.Y + Rectangle.Height, Rectangle.X, Rectangle.Y + Rectangle.Height - ArcRectangleWidth)
  1260.         End If
  1261.  
  1262.         AdvRect.CloseAllFigures()
  1263.  
  1264.         Return AdvRect
  1265.     End Function
  1266.  
  1267.     Public Function RoundRect(ByVal Rectangle As Rectangle, ByVal Curve As Integer) As GraphicsPath
  1268.         RoundRect = New GraphicsPath()
  1269.         Dim ArcRectangleWidth As Integer = Curve * 2
  1270.         RoundRect.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  1271.         RoundRect.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  1272.         RoundRect.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  1273.         RoundRect.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  1274.         RoundRect.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, ArcRectangleWidth + Rectangle.Y))
  1275.         RoundRect.CloseAllFigures()
  1276.         Return RoundRect
  1277.     End Function
  1278.  
  1279.     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
  1280.         Return RoundRect(New Rectangle(X, Y, Width, Height), Curve)
  1281.     End Function
  1282.  
  1283.     Class PillStyle
  1284.         Public Left As Boolean
  1285.         Public Right As Boolean
  1286.     End Class
  1287.  
  1288.     Public Function Pill(ByVal Rectangle As Rectangle, ByVal PillStyle As PillStyle) As GraphicsPath
  1289.         Pill = New GraphicsPath()
  1290.  
  1291.         If PillStyle.Left Then
  1292.             Pill.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, Rectangle.Height, Rectangle.Height), -270, 180)
  1293.         Else
  1294.             Pill.AddLine(Rectangle.X, Rectangle.Y + Rectangle.Height, Rectangle.X, Rectangle.Y)
  1295.         End If
  1296.  
  1297.         If PillStyle.Right Then
  1298.             Pill.AddArc(New Rectangle(Rectangle.X + Rectangle.Width - Rectangle.Height, Rectangle.Y, Rectangle.Height, Rectangle.Height), -90, 180)
  1299.         Else
  1300.             Pill.AddLine(Rectangle.X + Rectangle.Width, Rectangle.Y, Rectangle.X + Rectangle.Width, Rectangle.Y + Rectangle.Height)
  1301.         End If
  1302.  
  1303.         Pill.CloseAllFigures()
  1304.  
  1305.         Return Pill
  1306.     End Function
  1307.  
  1308.     Public Function Pill(ByVal X As Integer, ByVal Y As Integer, ByVal Width As Integer, ByVal Height As Integer, ByVal PillStyle As PillStyle)
  1309.         Return Pill(New Rectangle(X, Y, Width, Height), PillStyle)
  1310.     End Function
  1311.  
  1312. End Module
  1313. Class ThemedTrackBar
  1314.     Inherits Control
  1315.     'Base or Template used was from Tedd
  1316. #Region "Properties"
  1317.     Dim _Maximum As Integer = 10
  1318.     Public Property Maximum() As Integer
  1319.         Get
  1320.             Return _Maximum
  1321.         End Get
  1322.         Set(ByVal value As Integer)
  1323.             If value > 0 Then _Maximum = value
  1324.             If value < _Value Then _Value = value
  1325.             Invalidate()
  1326.         End Set
  1327.     End Property
  1328.  
  1329.     Event ValueChanged()
  1330.     Dim _Value As Integer = 0
  1331.     Public Property Value() As Integer
  1332.         Get
  1333.             Return _Value
  1334.         End Get
  1335.         Set(ByVal value As Integer)
  1336.  
  1337.             Select Case value
  1338.                 Case Is = _Value
  1339.                     Exit Property
  1340.                 Case Is < 0
  1341.                     _Value = 0
  1342.                 Case Is > _Maximum
  1343.                     _Value = _Maximum
  1344.                 Case Else
  1345.                     _Value = value
  1346.             End Select
  1347.  
  1348.             Invalidate()
  1349.             RaiseEvent ValueChanged()
  1350.         End Set
  1351.     End Property
  1352. #End Region
  1353.  
  1354.     Sub New()
  1355.         Me.SetStyle(ControlStyles.DoubleBuffer Or _
  1356.                     ControlStyles.AllPaintingInWmPaint Or _
  1357.                     ControlStyles.ResizeRedraw Or _
  1358.                     ControlStyles.UserPaint Or _
  1359.                     ControlStyles.Selectable Or _
  1360.                     ControlStyles.SupportsTransparentBackColor, True)
  1361.     End Sub
  1362.  
  1363.     Dim CaptureM As Boolean = False
  1364.     Dim Bar As Rectangle = New Rectangle(0, 10, Width - 1, Height - 21)
  1365.     Dim Track As Size = New Size(20, 20)
  1366.  
  1367.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  1368.         MyBase.OnPaint(e)
  1369.         Dim G As Graphics = e.Graphics
  1370.         Bar = New Rectangle(10, 10, Width - 21, Height - 21)
  1371.         G.Clear(Color.FromArgb(41, 54, 96))
  1372.         G.SmoothingMode = SmoothingMode.HighQuality
  1373.  
  1374.         'Background
  1375.         Dim BackLinear As LinearGradientBrush = New LinearGradientBrush(New Point(0, CInt((Height / 2) - 4)), New Point(0, CInt((Height / 2) + 4)), Color.FromArgb(65, 65, 65), Color.FromArgb(65, 65, 65))
  1376.         G.FillRectangle(New SolidBrush(Color.FromArgb(60, 73, 118)), New Rectangle(0, CInt((Height / 2) - 4), Width - 1, 8))
  1377.         '  G.DrawPath(ToPen(50, Color.Black), RoundRect(0, CInt((Height / 2) - 4), Width - 1, 8, 3))
  1378.         BackLinear.Dispose()
  1379.         G.FillRectangle(New SolidBrush(Color.FromArgb(87, 113, 190)), New Rectangle(0, CInt((Height / 2) - 4), Bar.X + CInt(Bar.Width * (Value / Maximum)) - CInt(Track.Width / 2) + 9, 8))
  1380.  
  1381.         'Fill
  1382.         '  G.FillPath(New LinearGradientBrush(New Point(1, CInt((Height / 2) - 4)), New Point(1, CInt((Height / 2) + 4)), Color.FromArgb(250, 200, 70), Color.FromArgb(250, 160, 40)), RoundRect(1, CInt((Height / 2) - 4), CInt(Bar.Width * (Value / Maximum)) + CInt(Track.Width / 2), 8, 3))
  1383.         ' G.DrawPath(ToPen(100, Color.White), RoundRect(2, CInt((Height / 2) - 2), CInt(Bar.Width * (Value / Maximum)) + CInt(Track.Width / 2), 4, 3))
  1384.         G.SetClip(RoundRect(1, CInt((Height / 2) - 4), CInt(Bar.Width * (Value / Maximum)) + CInt(Track.Width / 2), 8, 3))
  1385.         For i = 0 To CInt(Bar.Width * (Value / Maximum)) + CInt(Track.Width / 2) Step 10
  1386.             'G.FillEllipse(New SolidBrush(Color.FromArgb(27, 132, 188)), New Rectangle(New Point(i, CInt((Height / 2) - 10)), New Point(i - 10, CInt((Height / 2) + 10))))
  1387.         Next
  1388.         G.SetClip(New Rectangle(0, 0, Width, Height))
  1389.  
  1390.         'Button
  1391.         If inner = True Then
  1392.             ' G.FillEllipse(Brushes.White, New Rectangle(Bar.X + CInt(Bar.Width * (Value / Maximum)) - CInt(Track.Width / 2) + 3, Bar.Y + CInt((Bar.Height / 2)) - CInt(Track.Height / 2) + 3, Track.Width - 6, Track.Height - 6))
  1393.             ' G.DrawEllipse(ToPen(50, Color.Black), New Rectangle(Bar.X + CInt(Bar.Width * (Value / Maximum)) - CInt(Track.Width / 2) + 3, Bar.Y + CInt((Bar.Height / 2)) - CInt(Track.Height / 2) + 3, Track.Width - 6, Track.Height - 6))
  1394.             ' G.FillEllipse(New LinearGradientBrush(New Point(0, Bar.Y + CInt((Bar.Height / 2)) - CInt(Track.Height / 2)), New Point(0, Bar.Y + CInt((Bar.Height / 2)) - CInt(Track.Height / 2) + Track.Height), Color.FromArgb(200, Color.Black), Color.FromArgb(25, Color.Black)), New Rectangle(Bar.X + CInt(Bar.Width * (Value / Maximum)) - CInt(Track.Width / 2) + 6, Bar.Y + CInt((Bar.Height / 2)) - CInt(Track.Height / 2) + 6, Track.Width - 12, Track.Height - 12))
  1395.         Else
  1396.             '  G.FillEllipse(Brushes.White, New Rectangle(Bar.X + CInt(Bar.Width * (Value / Maximum)) - CInt(Track.Width / 2) + 3, Bar.Y + CInt((Bar.Height / 2)) - CInt(Track.Height / 2) + 3, Track.Width - 6, Track.Height - 6))
  1397.             '  G.DrawEllipse(ToPen(50, Color.Black), New Rectangle(Bar.X + CInt(Bar.Width * (Value / Maximum)) - CInt(Track.Width / 2) + 3, Bar.Y + CInt((Bar.Height / 2)) - CInt(Track.Height / 2) + 3, Track.Width - 6, Track.Height - 6))
  1398.         End If
  1399.     End Sub
  1400.  
  1401.     Protected Overrides Sub OnHandleCreated(ByVal e As System.EventArgs)
  1402.         Me.BackColor = Color.Transparent
  1403.  
  1404.         MyBase.OnHandleCreated(e)
  1405.     End Sub
  1406.     Dim inner As Boolean = False
  1407.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  1408.         MyBase.OnMouseDown(e)
  1409.         Dim mp = New Rectangle(New Point(e.Location.X, e.Location.Y), New Size(1, 1))
  1410.         Dim Bar As Rectangle = New Rectangle(10, 10, Width - 21, Height - 21)
  1411.         If New Rectangle(New Point(Bar.X + CInt(Bar.Width * (Value / Maximum)) - CInt(Track.Width / 2), 0), New Size(Track.Width, Height)).IntersectsWith(mp) Then
  1412.             CaptureM = True
  1413.             inner = True
  1414.         End If
  1415.     End Sub
  1416.  
  1417.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  1418.         MyBase.OnMouseUp(e)
  1419.         CaptureM = False
  1420.         inner = False
  1421.     End Sub
  1422.  
  1423.     Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)
  1424.         MyBase.OnMouseMove(e)
  1425.         If CaptureM Then
  1426.             Dim mp As Point = New Point(e.X, e.Y)
  1427.             Dim Bar As Rectangle = New Rectangle(10, 10, Width - 21, Height - 21)
  1428.             Value = CInt(Maximum * ((mp.X - Bar.X) / Bar.Width))
  1429.         End If
  1430.     End Sub
  1431.  
  1432.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  1433.         MyBase.OnMouseLeave(e) : CaptureM = False
  1434.     End Sub
  1435.  
  1436. End Class
  1437.  
  1438. #End Region
  1439. #Region "Reqution Theme"
  1440. Public Class LoginContainer
  1441.     Inherits ContainerControl
  1442.  
  1443.     Sub New()
  1444.         Me.Dock = DockStyle.Fill
  1445.         Me.DoubleBuffered = True
  1446.     End Sub
  1447.     'Paint
  1448. #Region "Paint"
  1449.     Private Sub LoginContainer_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  1450.         'Graphics type
  1451.         e.Graphics.SmoothingMode = SmoothingMode.HighQuality
  1452.         'Background
  1453.         e.Graphics.Clear(Color.FromArgb(45, 57, 96))
  1454.  
  1455.         'Top Gradient
  1456.         Dim rect = New Rectangle(1, 1, Me.Width, 45)
  1457.         Dim TopbarGrad = New LinearGradientBrush(rect, Color.FromArgb(66, 85, 144), Color.FromArgb(45, 57, 96), 180.0!)
  1458.         e.Graphics.FillRectangle(TopbarGrad, rect)
  1459.         rect = New Rectangle(1, 45, Me.Width, 3)
  1460.         TopbarGrad = New LinearGradientBrush(rect, Color.FromArgb(66, 85, 144), Color.FromArgb(50, 45, 57, 96), 180.0!)
  1461.         e.Graphics.FillRectangle(TopbarGrad, rect)
  1462.         'Border
  1463.         e.Graphics.DrawRectangle(New Pen(Color.Black), New Rectangle(0, 0, Me.Width - 1, Me.Height - 1))
  1464.     End Sub
  1465. #End Region
  1466. #Region "ThemeDraggable"
  1467.  
  1468.     Private savePoint As New Point(0, 0)
  1469.     Private isDragging As Boolean = False
  1470.  
  1471.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  1472.         Dim dragRect As New Rectangle(0, 0, Me.Width, 46)
  1473.         If dragRect.Contains(New Point(e.X, e.Y)) Then
  1474.             isDragging = True
  1475.             savePoint = New Point(e.X, e.Y)
  1476.         End If
  1477.         '
  1478.         MyBase.OnMouseDown(e)
  1479.     End Sub
  1480.  
  1481.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  1482.         isDragging = False
  1483.         MyBase.OnMouseUp(e)
  1484.     End Sub
  1485.  
  1486.     Private mouseX As Integer
  1487.     Private mouseY As Integer
  1488.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  1489.  
  1490.         mouseX = e.X
  1491.         mouseY = e.Y
  1492.         If isDragging Then
  1493.             Dim screenPoint As Point = PointToScreen(e.Location)
  1494.             FindForm().Location = New Point(screenPoint.X - Me.savePoint.X, screenPoint.Y - Me.savePoint.Y)
  1495.         End If
  1496.         MyBase.OnMouseMove(e)
  1497.         Invalidate()
  1498.     End Sub
  1499.  
  1500. #End Region
  1501. End Class
  1502. Public Class ControlBox
  1503.     Inherits Panel
  1504.     Sub New()
  1505.         Me.Size = New Size(50, 15)
  1506.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  1507.            ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  1508.            ControlStyles.SupportsTransparentBackColor, True)
  1509.         DoubleBuffered = True
  1510.         BackColor = Color.Transparent
  1511.         Parent = FindForm()
  1512.     End Sub
  1513. #Region "Paint"
  1514.     Private Sub ControlBox_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  1515.         e.Graphics.SmoothingMode = SmoothingMode.HighQuality
  1516.         'red button
  1517.         Dim redrect = New Rectangle(2, 2, 10, 10)
  1518.         Dim redCicleGrad = New LinearGradientBrush(redrect, Color.FromArgb(50, 255, 255, 255), Color.FromArgb(219, 69, 61), 90.0!)
  1519.         e.Graphics.FillEllipse(New SolidBrush(Color.FromArgb(219, 69, 61)), redrect)
  1520.         e.Graphics.FillEllipse(redCicleGrad, redrect)
  1521.         'yellow
  1522.         Dim yelrect = New Rectangle(16, 2, 10, 10)
  1523.         Dim yelCicleGrad = New LinearGradientBrush(yelrect, Color.FromArgb(50, 255, 255, 255), Color.FromArgb(223, 158, 76), 90.0!)
  1524.         e.Graphics.FillEllipse(New SolidBrush(Color.FromArgb(223, 158, 76)), yelrect)
  1525.         e.Graphics.FillEllipse(yelCicleGrad, yelrect)
  1526.         'green
  1527.         Dim grerect = New Rectangle(30, 2, 10, 10)
  1528.         Dim greCicleGrad = New LinearGradientBrush(grerect, Color.FromArgb(50, 255, 255, 255), Color.FromArgb(102, 170, 75), 90.0!)
  1529.         e.Graphics.FillEllipse(New SolidBrush(Color.FromArgb(102, 170, 75)), grerect)
  1530.         e.Graphics.FillEllipse(greCicleGrad, grerect)
  1531.     End Sub
  1532. #End Region
  1533. #Region "ThemeDraggable"
  1534.     Dim clickedd As Boolean = False
  1535.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  1536.         If New Rectangle(2, 2, 10, 10).Contains(mouseX, mouseY) Then
  1537.             If e.Button = Windows.Forms.MouseButtons.Left Then
  1538.                 Environment.Exit(0)
  1539.             End If
  1540.         End If
  1541.         If New Rectangle(16, 2, 10, 10).Contains(mouseX, mouseY) Then
  1542.             If e.Button = Windows.Forms.MouseButtons.Left Then
  1543.                 If FindForm.WindowState = FormWindowState.Maximized Then
  1544.                 Else
  1545.  
  1546.                 End If
  1547.                 FindForm.WindowState = FormWindowState.Minimized
  1548.             End If
  1549.         End If
  1550.         If New Rectangle(30, 2, 10, 10).Contains(mouseX, mouseY) Then
  1551.             If e.Button = Windows.Forms.MouseButtons.Left Then
  1552.                 If FindForm.WindowState = FormWindowState.Maximized Then
  1553.                     FindForm.WindowState = FormWindowState.Normal
  1554.                 Else
  1555.                     FindForm.WindowState = FormWindowState.Maximized
  1556.                 End If
  1557.             End If
  1558.         End If
  1559.         '
  1560.         MyBase.OnMouseDown(e)
  1561.     End Sub
  1562.  
  1563.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  1564.  
  1565.         MyBase.OnMouseUp(e)
  1566.     End Sub
  1567.  
  1568.     Private mouseX As Integer
  1569.     Private mouseY As Integer
  1570.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  1571.  
  1572.         mouseX = e.X
  1573.         mouseY = e.Y
  1574.         If New Rectangle(2, 2, 10, 10).Contains(mouseX, mouseY) Or New Rectangle(16, 2, 10, 10).Contains(mouseX, mouseY) Or New Rectangle(30, 2, 10, 10).Contains(mouseX, mouseY) Then
  1575.             Cursor = Cursors.Hand
  1576.         Else
  1577.             Cursor = Cursors.Arrow
  1578.         End If
  1579.         MyBase.OnMouseMove(e)
  1580.         Invalidate()
  1581.     End Sub
  1582.  
  1583. #End Region
  1584. End Class
  1585. Public Class LoginBox
  1586.     Inherits Panel
  1587.     Event Clicked()
  1588.     Protected Overrides Sub OnCreateControl()
  1589.         MyBase.OnCreateControl()
  1590.         If Not Controls.Contains(TB) Then
  1591.             Controls.Add(TB)
  1592.             Controls.Add(TB2)
  1593.         End If
  1594.     End Sub
  1595. #Region "Modules & Functions"
  1596.     Public Sub DrawRoundRect(g As Graphics, p As Pen, x As Single, y As Single, width As Single, height As Single, _
  1597.        radius As Single)
  1598.         Dim gp As New GraphicsPath()
  1599.  
  1600.         gp.AddLine(x + radius, y, x + width - (radius * 2), y)
  1601.         ' Line
  1602.         gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90)
  1603.         ' Corner
  1604.         gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2))
  1605.         ' Line
  1606.         gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, radius * 2, 0, 90)
  1607.         ' Corner
  1608.         gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height)
  1609.         ' Line
  1610.         gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90)
  1611.         ' Corner
  1612.         gp.AddLine(x, y + height - (radius * 2), x, y + radius)
  1613.         ' Line
  1614.         gp.AddArc(x, y, radius * 2, radius * 2, 180, 90)
  1615.         ' Corner
  1616.         gp.CloseFigure()
  1617.  
  1618.         g.DrawPath(p, gp)
  1619.         gp.Dispose()
  1620.     End Sub
  1621.     Public Sub FillRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  1622.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  1623.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
  1624.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  1625.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  1626.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  1627.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  1628.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  1629.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  1630.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  1631.         g.SmoothingMode = mode
  1632.     End Sub
  1633.     Public Sub FillNotTopRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  1634.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  1635.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
  1636.         g.FillPie(b, r.X, r.Y, 1, 1, 180, 90)
  1637.         g.FillPie(b, r.X + r.Width - d, r.Y, 1, 1, 270, 90)
  1638.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  1639.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  1640.         ' g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  1641.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  1642.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  1643.         g.SmoothingMode = mode
  1644.     End Sub
  1645.  
  1646. #End Region
  1647.     Sub New()
  1648.         Me.Size = New Size(234, 178)
  1649.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  1650.            ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  1651.            ControlStyles.SupportsTransparentBackColor, True)
  1652.         DoubleBuffered = True
  1653.         BackColor = Color.Transparent
  1654.         Parent = FindForm()
  1655.         'Textbox 1
  1656.         MyBase.Font = New Font("Arial", 12, FontStyle.Regular)
  1657.         TB = New Windows.Forms.TextBox
  1658.         TB.BackColor = _BaseColour
  1659.         TB.Font = New Font("Segoe UI", 9)
  1660.         TB.Text = Text
  1661.         TB.BackColor = _BaseColour
  1662.         TB.ForeColor = _TextColour
  1663.         TB.MaxLength = _MaxLength
  1664.         TB.Multiline = False
  1665.         TB.ReadOnly = _ReadOnly
  1666.         TB.UseSystemPasswordChar = _UseSystemPasswordChar
  1667.         TB.BorderStyle = BorderStyle.None
  1668.         TB.Location = New Point(20, 20)
  1669.         TB.Width = Width - 10
  1670.         TB.Font = MyBase.Font
  1671.         'Textbox2
  1672.         TB2 = New Windows.Forms.TextBox
  1673.         TB2.BackColor = _BaseColour
  1674.         TB2.Font = New Font("Segoe UI", 9)
  1675.         TB2.Text = Text
  1676.         TB2.BackColor = _BaseColour
  1677.         TB2.ForeColor = _TextColour
  1678.         TB2.MaxLength = _MaxLength
  1679.         TB2.Multiline = False
  1680.         TB2.ReadOnly = _ReadOnly
  1681.         TB2.UseSystemPasswordChar = _UseSystemPasswordChar
  1682.         TB2.BorderStyle = BorderStyle.None
  1683.         TB2.Location = New Point(20, 85)
  1684.         TB2.Width = Width - 10
  1685.         TB2.Font = MyBase.Font
  1686.     End Sub
  1687. #Region "paint"
  1688.     Private Sub LoginBox_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  1689.         e.Graphics.SmoothingMode = SmoothingMode.HighQuality
  1690.  
  1691.         Dim Rect = New Rectangle(0, 0, Me.Width, Me.Height - 10)
  1692.         Dim GradBrush = New LinearGradientBrush(New Rectangle(0, 0, Me.Width, Me.Height - 64), Color.FromArgb(243, 240, 243), Color.FromArgb(212, 207, 203), 90.0!)
  1693.         FillRoundedRectangle(e.Graphics, Rect, 18, GradBrush)
  1694.         '  DrawRoundRect(e.Graphics, New Pen(Color.FromArgb(240, 240, 240)), 0, 0, Me.Width, Me.Height, 18)
  1695.         If clickedd = False Then
  1696.             Rect = New Rectangle(0, Me.Height - 70, Me.Width, 70)
  1697.             GradBrush = New LinearGradientBrush(Rect, Color.FromArgb(147, 179, 201), Color.FromArgb(68, 93, 113), 90.0!)
  1698.             FillNotTopRoundedRectangle(e.Graphics, Rect, 18, GradBrush)
  1699.         Else
  1700.             Rect = New Rectangle(0, Me.Height - 70, Me.Width, 70)
  1701.             GradBrush = New LinearGradientBrush(Rect, Color.FromArgb(68, 93, 113), Color.FromArgb(48, 73, 93), 90.0!)
  1702.             FillNotTopRoundedRectangle(e.Graphics, Rect, 18, GradBrush)
  1703.         End If
  1704.         GradBrush = New LinearGradientBrush(Rect, Color.FromArgb(50, Color.Black), Color.FromArgb(147, 179, 201), 90.0!)
  1705.         Rect = New Rectangle(0, Me.Height - 64, Me.Width, 4)
  1706.         e.Graphics.FillRectangle(GradBrush, Rect)
  1707.         e.Graphics.DrawLine(New Pen(Color.FromArgb(191, 191, 191)), New Point(0, 60), New Point(Me.Width, 60))
  1708.         e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(240, 240, 240)), New Rectangle(6, 0, 5, 10))
  1709.         e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(240, 240, 240)), New Rectangle(Me.Width - 10, 0, 5, 5))
  1710.         e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(240, 240, 240)), New Rectangle(0, 5, Me.Width, 10))
  1711.         'Fix Bottom
  1712.         If clickedd = False Then
  1713.             e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(77, 103, 123)), New Rectangle(7, Me.Height - 8, 2, 7))
  1714.             e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(77, 103, 123)), New Rectangle(Me.Width - 10, Me.Height - 8, 2, 7))
  1715.             e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(77, 103, 123)), New Rectangle(0, Me.Height - 10, Me.Width, 2))
  1716.         Else
  1717.             e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(48, 73, 93)), New Rectangle(7, Me.Height - 8, 2, 7))
  1718.             e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(48, 73, 93)), New Rectangle(Me.Width - 10, Me.Height - 8, 2, 7))
  1719.             e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(48, 73, 93)), New Rectangle(0, Me.Height - 10, Me.Width, 2))
  1720.         End If
  1721.        
  1722.         If clickedd = False Then
  1723.             If New Rectangle(10, Me.Height - 60, Me.Width - 20, 70).Contains(mouseX, mouseY) Then
  1724.                 'e.Graphics.FillEllipse(New SolidBrush(Color.FromArgb(50, Color.White)), New Rectangle(mouseX - 7, mouseY - 7, 14, 14))
  1725.                 'e.Graphics.FillEllipse(New SolidBrush(Color.FromArgb(60, Color.White)), New Rectangle(mouseX - 8, mouseY - 8, 16, 16))
  1726.                 'e.Graphics.FillEllipse(New SolidBrush(Color.FromArgb(70, Color.White)), New Rectangle(mouseX - 10, mouseY - 10, 20, 20))
  1727.                 'e.Graphics.FillEllipse(New SolidBrush(Color.FromArgb(100, Color.White)), New Rectangle(mouseX - 3, mouseY - 3, 5, 5))
  1728.                 e.Graphics.DrawString("Sign In", New Font("Arial", 18, FontStyle.Regular), New SolidBrush(Color.FromArgb(50, Color.White)), New Rectangle(0, Me.Height - 65, Me.Width, 70), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  1729.                 e.Graphics.DrawString("Sign In", New Font("Arial", 17, FontStyle.Regular), New SolidBrush(Color.FromArgb(50, Color.White)), New Rectangle(0, Me.Height - 65, Me.Width, 70), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  1730.             End If
  1731.         End If
  1732.         'Textboxs
  1733.         TB.Text = _Text
  1734.         TB.BackColor = _BaseColour
  1735.         TB.ForeColor = _TextColour
  1736.         TB.Location = New Point(20, 20)
  1737.         TB.Width = Width - 40
  1738.         TB2.Text = _Text2
  1739.         TB2.BackColor = _BaseColour2
  1740.         TB2.ForeColor = _TextColour2
  1741.         TB2.Location = New Point(20, 85)
  1742.         TB2.Width = Width - 40
  1743.         'Sign In
  1744.         e.Graphics.DrawString("Sign In", New Font("Arial", 16, FontStyle.Regular), Brushes.White, New Rectangle(0, Me.Height - 65, Me.Width, 70), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  1745.         clickedd = False
  1746.     End Sub
  1747. #End Region
  1748. #Region "Properties & Events"
  1749.     Private WithEvents TB2 As TextBox
  1750.     Private WithEvents TB As New TextBox
  1751.     Private _BaseColour As Color = Color.FromArgb(236, 233, 234)
  1752.     Private _BorderColour As Color = Color.FromArgb(163, 190, 146)
  1753.     Private _LineColour As Color = Color.FromArgb(221, 221, 221)
  1754.     Private _TextColour As Color = Color.FromArgb(149, 147, 148)
  1755.     Private _TextAlign As HorizontalAlignment = HorizontalAlignment.Left
  1756.     Private _MaxLength As Integer = 32767
  1757.     Private _ReadOnly As Boolean
  1758.     Private _UseSystemPasswordChar As Boolean
  1759.     Private _Text As String = "Username"
  1760.     Private _Text2 As String = "Password"
  1761.     Private _BaseColour2 As Color = Color.FromArgb(218, 213, 211)
  1762.     Private _BorderColour2 As Color = Color.FromArgb(163, 190, 146)
  1763.     Private _LineColour2 As Color = Color.FromArgb(221, 221, 221)
  1764.     Private _TextColour2 As Color = Color.FromArgb(149, 147, 148)
  1765.     Private _TextAlign2 As HorizontalAlignment = HorizontalAlignment.Left
  1766.     Private _MaxLength2 As Integer = 32767
  1767.     Private _ReadOnly2 As Boolean
  1768.     Private _UseSystemPasswordChar2 As Boolean
  1769.     Private _Multiline As Boolean
  1770.     Public Sub SelectAll()
  1771.         TB.Focus()
  1772.         TB.SelectAll()
  1773.         Invalidate()
  1774.     End Sub
  1775.  
  1776.     <Category("Username")>
  1777.     Public Property BaseColour As Color
  1778.         Get
  1779.             Return _BaseColour
  1780.         End Get
  1781.         Set(value As Color)
  1782.             _BaseColour = value
  1783.         End Set
  1784.     End Property
  1785.  
  1786.     <Category("Username")>
  1787.   Public Property BorderColour As Color
  1788.         Get
  1789.             Return _BorderColour
  1790.         End Get
  1791.         Set(value As Color)
  1792.             _BorderColour = value
  1793.         End Set
  1794.     End Property
  1795.  
  1796.     <Category("Username")>
  1797.     Public Property LineColour As Color
  1798.         Get
  1799.             Return _LineColour
  1800.         End Get
  1801.         Set(value As Color)
  1802.             _LineColour = value
  1803.         End Set
  1804.     End Property
  1805.  
  1806.     <Category("Username")>
  1807.      Public Property TextColour As Color
  1808.         Get
  1809.             Return _TextColour
  1810.         End Get
  1811.         Set(value As Color)
  1812.             _TextColour = value
  1813.         End Set
  1814.     End Property
  1815.  
  1816.  
  1817.  
  1818.     <Category("Username")>
  1819.     Property TextAlign() As HorizontalAlignment
  1820.         Get
  1821.             Return _TextAlign
  1822.         End Get
  1823.         Set(ByVal value As HorizontalAlignment)
  1824.             _TextAlign = value
  1825.             If TB IsNot Nothing Then
  1826.                 TB.TextAlign = value
  1827.             End If
  1828.         End Set
  1829.     End Property
  1830.  
  1831.     <Category("Username")>
  1832.     Property MaxLength() As Integer
  1833.         Get
  1834.             Return _MaxLength
  1835.         End Get
  1836.         Set(ByVal value As Integer)
  1837.             _MaxLength = value
  1838.             If TB IsNot Nothing Then
  1839.                 TB.MaxLength = value
  1840.             End If
  1841.         End Set
  1842.     End Property
  1843.  
  1844.     <Category("Username")>
  1845.     Property [ReadOnly]() As Boolean
  1846.         Get
  1847.             Return _ReadOnly
  1848.         End Get
  1849.         Set(ByVal value As Boolean)
  1850.             _ReadOnly = value
  1851.             If TB IsNot Nothing Then
  1852.                 TB.ReadOnly = value
  1853.             End If
  1854.         End Set
  1855.     End Property
  1856.  
  1857.     <Category("Username")>
  1858.     Property UseSystemPasswordChar() As Boolean
  1859.         Get
  1860.             Return _UseSystemPasswordChar
  1861.         End Get
  1862.         Set(ByVal value As Boolean)
  1863.             _UseSystemPasswordChar = value
  1864.             If TB IsNot Nothing Then
  1865.                 TB.UseSystemPasswordChar = value
  1866.             End If
  1867.         End Set
  1868.     End Property
  1869.     <Category("Username")>
  1870.     Property Textt As String
  1871.         Get
  1872.             Return _Text
  1873.         End Get
  1874.         Set(ByVal value As String)
  1875.             _Text = value
  1876.             If TB IsNot Nothing Then
  1877.                 TB.Text = value
  1878.             End If
  1879.         End Set
  1880.     End Property
  1881.  
  1882.  
  1883.     'Password
  1884.     <Category("Password")>
  1885.     Property Text2 As String
  1886.         Get
  1887.             Return _Text2
  1888.         End Get
  1889.         Set(ByVal value As String)
  1890.             _Text = value
  1891.             If TB2 IsNot Nothing Then
  1892.                 TB2.Text = value
  1893.             End If
  1894.         End Set
  1895.     End Property
  1896.     <Category("Password")>
  1897.     Public Property BaseColour2 As Color
  1898.         Get
  1899.             Return _BaseColour2
  1900.         End Get
  1901.         Set(value As Color)
  1902.             _BaseColour2 = value
  1903.         End Set
  1904.     End Property
  1905.  
  1906.     <Category("Password")>
  1907.     Public Property BorderColour2 As Color
  1908.         Get
  1909.             Return _BorderColour2
  1910.         End Get
  1911.         Set(value As Color)
  1912.             _BorderColour2 = value
  1913.         End Set
  1914.     End Property
  1915.  
  1916.     <Category("Password")>
  1917.     Public Property LineColour2 As Color
  1918.         Get
  1919.             Return _LineColour2
  1920.         End Get
  1921.         Set(value As Color)
  1922.             _LineColour2 = value
  1923.         End Set
  1924.     End Property
  1925.  
  1926.     <Category("Password")>
  1927.     Public Property TextColour2 As Color
  1928.         Get
  1929.             Return _TextColour2
  1930.         End Get
  1931.         Set(value As Color)
  1932.             _TextColour2 = value
  1933.         End Set
  1934.     End Property
  1935.  
  1936.  
  1937.  
  1938.     <Category("Password")>
  1939.     Property TextAlign2() As HorizontalAlignment
  1940.         Get
  1941.             Return _TextAlign2
  1942.         End Get
  1943.         Set(ByVal value As HorizontalAlignment)
  1944.             _TextAlign = value
  1945.             If TB2 IsNot Nothing Then
  1946.                 TB2.TextAlign = value
  1947.             End If
  1948.         End Set
  1949.     End Property
  1950.  
  1951.     <Category("Password")>
  1952.     Property MaxLength2() As Integer
  1953.         Get
  1954.             Return _MaxLength2
  1955.         End Get
  1956.         Set(ByVal value As Integer)
  1957.             _MaxLength2 = value
  1958.             If TB2 IsNot Nothing Then
  1959.                 TB2.MaxLength = value
  1960.             End If
  1961.         End Set
  1962.     End Property
  1963.  
  1964.     <Category("Password")>
  1965.     Property [ReadOnly2]() As Boolean
  1966.         Get
  1967.             Return _ReadOnly2
  1968.         End Get
  1969.         Set(ByVal value As Boolean)
  1970.             _ReadOnly2 = value
  1971.             If TB2 IsNot Nothing Then
  1972.                 TB2.ReadOnly = value
  1973.             End If
  1974.         End Set
  1975.     End Property
  1976.  
  1977.     <Category("Password")>
  1978.     Property UseSystemPasswordChar2() As Boolean
  1979.         Get
  1980.             Return _UseSystemPasswordChar2
  1981.         End Get
  1982.         Set(ByVal value As Boolean)
  1983.             _UseSystemPasswordChar2 = value
  1984.             If TB2 IsNot Nothing Then
  1985.                 TB2.UseSystemPasswordChar = value
  1986.             End If
  1987.         End Set
  1988.     End Property
  1989.     <Category("Password")>
  1990.     Overrides Property Text As String
  1991.         Get
  1992.             Return _Text2
  1993.         End Get
  1994.         Set(ByVal value As String)
  1995.             _Text2 = value
  1996.             If TB2 IsNot Nothing Then
  1997.                 TB2.Text = value
  1998.             End If
  1999.         End Set
  2000.     End Property
  2001.  
  2002.     <Category("Control")>
  2003.     Overrides Property Font As Font
  2004.         Get
  2005.             Return MyBase.Font
  2006.         End Get
  2007.         Set(ByVal value As Font)
  2008.             MyBase.Font = value
  2009.             If TB2 IsNot Nothing Then
  2010.                 TB2.Font = value
  2011.                 TB2.Location = New Point(3, 5)
  2012.                 TB2.Width = Width - 6
  2013.                 TB.Font = value
  2014.                 TB.Location = New Point(3, 5)
  2015.                 TB.Width = Width - 6
  2016.                 If Not _Multiline Then
  2017.                     Height = TB.Height + 11
  2018.                 End If
  2019.             End If
  2020.         End Set
  2021.     End Property
  2022.  
  2023.  
  2024.     Private Sub OnBaseTextChanged(ByVal s As Object, ByVal e As EventArgs)
  2025.         _Text = TB.Text
  2026.         _Text2 = TB2.Text
  2027.     End Sub
  2028.  
  2029.     Protected Overrides Sub OnResize(ByVal e As EventArgs)
  2030.  
  2031.         TB.Location = New Point(20, 20)
  2032.         TB.Width = Width - 10
  2033.         'TB2.Location = New Point(85, 85)
  2034.         'TB2.Width = Width - 10
  2035.  
  2036.         MyBase.OnResize(e)
  2037.     End Sub
  2038.  
  2039. #End Region
  2040. #Region "ThemeDraggable"
  2041.     Dim clickedd As Boolean = False
  2042.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  2043.         If New Rectangle(0, 0, Me.Width, Me.Height).Contains(mouseX, mouseY) Then
  2044.             If e.Button = Windows.Forms.MouseButtons.Left Then
  2045.                 RaiseEvent Clicked()
  2046.                 clickedd = True
  2047.             End If
  2048.         End If
  2049.         '
  2050.         MyBase.OnMouseDown(e)
  2051.     End Sub
  2052.  
  2053.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  2054.  
  2055.         MyBase.OnMouseUp(e)
  2056.     End Sub
  2057.  
  2058.     Private mouseX As Integer
  2059.     Private mouseY As Integer
  2060.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  2061.  
  2062.         mouseX = e.X
  2063.         mouseY = e.Y
  2064.         If New Rectangle(0, Me.Height - 70, Me.Width, 70).Contains(mouseX, mouseY) Then
  2065.             Cursor = Cursors.Hand
  2066.         Else
  2067.             Cursor = Cursors.Arrow
  2068.         End If
  2069.         MyBase.OnMouseMove(e)
  2070.         Invalidate()
  2071.     End Sub
  2072.  
  2073. #End Region
  2074. End Class
  2075. #End Region
  2076. 'All credits go to there rightful owners :P - Nettro
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement