Advertisement
XertzHF

LogIn Theme GDI

Dec 18th, 2013
13,908
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 190.17 KB | None | 0 0
  1. Option Strict On
  2.  
  3. Imports System.Drawing.Text
  4. Imports System.Drawing.Drawing2D
  5. Imports System.ComponentModel
  6.  
  7. ''     DO NOT REMOVE CREDITS! IF YOU USE PLEASE CREDIT!     ''
  8.  
  9. ''' <summary>
  10. ''' LogIn GDI+ Theme
  11. ''' Creator: Xertz (HF)
  12. ''' Version: 1.4
  13. ''' Control Count: 28
  14. ''' Date Created: 18/12/2013
  15. ''' Date Changed: 07/09/2014
  16. ''' UID: 1602992
  17. ''' For any bugs / errors, PM me.
  18. ''' </summary>
  19. ''' <remarks></remarks>
  20.  
  21. Module DrawHelpers
  22.  
  23. #Region "Functions"
  24.  
  25.     Public Function RoundRectangle(ByVal Rectangle As Rectangle, ByVal Curve As Integer) As GraphicsPath
  26.         Dim P As GraphicsPath = New GraphicsPath()
  27.         Dim ArcRectangleWidth As Integer = Curve * 2
  28.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  29.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  30.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  31.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  32.         P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
  33.         Return P
  34.     End Function
  35.  
  36.     Public Function RoundRect(x!, y!, w!, h!, Optional r! = 0.3, Optional TL As Boolean = True, Optional TR As Boolean = True, Optional BR As Boolean = True, Optional BL As Boolean = True) As GraphicsPath
  37.         Dim d! = Math.Min(w, h) * r, xw = x + w, yh = y + h
  38.         RoundRect = New GraphicsPath
  39.         With RoundRect
  40.             If TL Then .AddArc(x, y, d, d, 180, 90) Else .AddLine(x, y, x, y)
  41.             If TR Then .AddArc(xw - d, y, d, d, 270, 90) Else .AddLine(xw, y, xw, y)
  42.             If BR Then .AddArc(xw - d, yh - d, d, d, 0, 90) Else .AddLine(xw, yh, xw, yh)
  43.             If BL Then .AddArc(x, yh - d, d, d, 90, 90) Else .AddLine(x, yh, x, yh)
  44.             .CloseFigure()
  45.         End With
  46.     End Function
  47.  
  48.     Enum MouseState As Byte
  49.         None = 0
  50.         Over = 1
  51.         Down = 2
  52.         Block = 3
  53.     End Enum
  54.  
  55. #End Region
  56.  
  57. End Module
  58.  
  59. Public Class LogInThemeContainer
  60.     Inherits ContainerControl
  61.  
  62. #Region "Declarations"
  63.     Private _CloseChoice As __CloseChoice = __CloseChoice.Form
  64.     Private _FontSize As Integer = 12
  65.     Private ReadOnly _Font As Font = New Font("Segoe UI", _FontSize)
  66.     Private MouseXLoc As Integer
  67.     Private MouseYLoc As Integer
  68.     Private CaptureMovement As Boolean = False
  69.     Private Const MoveHeight As Integer = 35
  70.     Private MouseP As Point = New Point(0, 0)
  71.     Private _FontColour As Color = Color.FromArgb(255, 255, 255)
  72.     Private _BaseColour As Color = Color.FromArgb(35, 35, 35)
  73.     Private _ContainerColour As Color = Color.FromArgb(54, 54, 54)
  74.     Private _BorderColour As Color = Color.FromArgb(60, 60, 60)
  75.     Private _HoverColour As Color = Color.FromArgb(42, 42, 42)
  76. #End Region
  77.  
  78. #Region "Size Handling"
  79.  
  80.     Private _LockWidth As Integer
  81.     Protected Property LockWidth() As Integer
  82.         Get
  83.             Return _LockWidth
  84.         End Get
  85.         Set(ByVal value As Integer)
  86.             _LockWidth = value
  87.             If Not LockWidth = 0 AndAlso IsHandleCreated Then Width = LockWidth
  88.         End Set
  89.     End Property
  90.  
  91.     Private _LockHeight As Integer
  92.     Protected Property LockHeight() As Integer
  93.         Get
  94.             Return _LockHeight
  95.         End Get
  96.         Set(ByVal value As Integer)
  97.             _LockHeight = value
  98.             If Not LockHeight = 0 AndAlso IsHandleCreated Then Height = LockHeight
  99.         End Set
  100.     End Property
  101.  
  102.     Private Frame As Rectangle
  103.     Protected NotOverridable Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  104.         If _Movable AndAlso Not _ControlMode Then
  105.             Frame = New Rectangle(7, 7, Width - 14, 35)
  106.         End If
  107.  
  108.         Invalidate()
  109.  
  110.         MyBase.OnSizeChanged(e)
  111.     End Sub
  112.  
  113.     Protected Overrides Sub SetBoundsCore(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal specified As BoundsSpecified)
  114.         If Not _LockWidth = 0 Then width = _LockWidth
  115.         If Not _LockHeight = 0 Then height = _LockHeight
  116.         MyBase.SetBoundsCore(x, y, width, height, specified)
  117.     End Sub
  118.  
  119. #End Region
  120.  
  121. #Region "State Handling"
  122.  
  123.     Private State As MouseState = MouseState.None
  124.     Private Sub SetState(ByVal current As MouseState)
  125.         State = current
  126.         Invalidate()
  127.     End Sub
  128.  
  129.     Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
  130.         If Not (_IsParentForm AndAlso ParentForm.WindowState = FormWindowState.Maximized) Then
  131.             If _Sizable AndAlso Not _ControlMode Then InvalidateMouse()
  132.         End If
  133.         MyBase.OnMouseMove(e)
  134.         SetState(MouseState.Over)
  135.     End Sub
  136.  
  137.     Protected Overrides Sub OnEnabledChanged(ByVal e As EventArgs)
  138.         If Enabled Then SetState(MouseState.None) Else SetState(MouseState.Block)
  139.         MyBase.OnEnabledChanged(e)
  140.     End Sub
  141.  
  142.     Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs)
  143.         SetState(MouseState.Over)
  144.         MyBase.OnMouseEnter(e)
  145.     End Sub
  146.  
  147.     Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs)
  148.         SetState(MouseState.Over)
  149.         MyBase.OnMouseUp(e)
  150.     End Sub
  151.  
  152.     Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs)
  153.         SetState(MouseState.None)
  154.         If GetChildAtPoint(PointToClient(MousePosition)) IsNot Nothing Then
  155.             If _Sizable AndAlso Not _ControlMode Then
  156.                 Cursor = Cursors.Default
  157.                 Previous = 0
  158.             End If
  159.         End If
  160.         MyBase.OnMouseLeave(e)
  161.     End Sub
  162.  
  163.     Private GetMouseLocation As Point
  164.     Private OldSize As Size
  165.     Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  166.         If e.Button = Windows.Forms.MouseButtons.Left Then SetState(MouseState.Down)
  167.         If Not (_IsParentForm AndAlso ParentForm.WindowState = FormWindowState.Maximized OrElse _ControlMode) Then
  168.             If _Movable AndAlso Frame.Contains(e.Location) Then
  169.                 Capture = False
  170.                 WM_LMBUTTONDOWN = True
  171.                 DefWndProc(Messages(0))
  172.             ElseIf _Sizable AndAlso Not Previous = 0 Then
  173.                 Capture = False
  174.                 WM_LMBUTTONDOWN = True
  175.                 DefWndProc(Messages(Previous))
  176.             End If
  177.         End If
  178.         GetMouseLocation = PointToClient(MousePosition)
  179.         If GetMouseLocation.X > Width - 39 AndAlso GetMouseLocation.X < Width - 16 AndAlso GetMouseLocation.Y < 22 Then
  180.             If _AllowClose Then
  181.                 If _CloseChoice = __CloseChoice.Application Then
  182.                     Environment.Exit(0)
  183.                 Else
  184.                     ParentForm.Close()
  185.                 End If
  186.             End If
  187.             ElseIf GetMouseLocation.X > Width - 64 AndAlso GetMouseLocation.X < Width - 41 AndAlso GetMouseLocation.Y < 22 Then
  188.                 If _AllowMaximize Then
  189.                     Select Case FindForm.WindowState
  190.                         Case FormWindowState.Maximized
  191.                             FindForm.WindowState = FormWindowState.Normal
  192.                         Case FormWindowState.Normal
  193.                             OldSize = Size
  194.                             FindForm.WindowState = FormWindowState.Maximized
  195.                     End Select
  196.                 End If
  197.             ElseIf GetMouseLocation.X > Width - 89 AndAlso GetMouseLocation.X < Width - 66 AndAlso GetMouseLocation.Y < 22 Then
  198.                 If _AllowMinimize Then
  199.                     Select Case FindForm.WindowState
  200.                         Case FormWindowState.Normal
  201.                             OldSize = Size
  202.                             FindForm.WindowState = FormWindowState.Minimized
  203.                         Case FormWindowState.Maximized
  204.                             FindForm.WindowState = FormWindowState.Minimized
  205.                     End Select
  206.                 End If
  207.             End If
  208.             MyBase.OnMouseDown(e)
  209.     End Sub
  210.  
  211.     Private Messages(8) As Message
  212.     Private Sub InitializeMessages()
  213.         Messages(0) = Message.Create(Parent.Handle, 161, New IntPtr(2), IntPtr.Zero)
  214.         For I As Integer = 1 To 8
  215.             Messages(I) = Message.Create(Parent.Handle, 161, New IntPtr(I + 9), IntPtr.Zero)
  216.         Next
  217.     End Sub
  218.  
  219.     Private GetIndexPoint As Point
  220.     Private B1, B2, B3, B4 As Boolean
  221.     Private Function GetMouseIndex() As Integer
  222.         GetIndexPoint = PointToClient(MousePosition)
  223.         B1 = GetIndexPoint.X < 6
  224.         B2 = GetIndexPoint.X > Width - 6
  225.         B3 = GetIndexPoint.Y < 6
  226.         B4 = GetIndexPoint.Y > Height - 6
  227.         If B1 AndAlso B3 Then Return 4
  228.         If B1 AndAlso B4 Then Return 7
  229.         If B2 AndAlso B3 Then Return 5
  230.         If B2 AndAlso B4 Then Return 8
  231.         If B1 Then Return 1
  232.         If B2 Then Return 2
  233.         If B3 Then Return 3
  234.         If B4 Then Return 6
  235.         Return 0
  236.     End Function
  237.  
  238.     Private Current, Previous As Integer
  239.     Private Sub InvalidateMouse()
  240.         Current = GetMouseIndex()
  241.         If Current = Previous Then Return
  242.         Previous = Current
  243.         Select Case Previous
  244.             Case 0
  245.                 Cursor = Cursors.Default
  246.             Case 1, 2
  247.                 Cursor = Cursors.SizeWE
  248.             Case 3, 6
  249.                 Cursor = Cursors.SizeNS
  250.             Case 4, 8
  251.                 Cursor = Cursors.SizeNWSE
  252.             Case 5, 7
  253.                 Cursor = Cursors.SizeNESW
  254.         End Select
  255.     End Sub
  256.  
  257.     Private WM_LMBUTTONDOWN As Boolean
  258.     Protected Overrides Sub WndProc(ByRef m As Message)
  259.         MyBase.WndProc(m)
  260.  
  261.         If WM_LMBUTTONDOWN AndAlso m.Msg = 513 Then
  262.             WM_LMBUTTONDOWN = False
  263.  
  264.             SetState(MouseState.Over)
  265.             If Not _SmartBounds Then Return
  266.  
  267.             If IsParentMdi Then
  268.                 CorrectBounds(New Rectangle(Point.Empty, Parent.Parent.Size))
  269.             Else
  270.                 Try : CorrectBounds(Screen.FromControl(Parent).WorkingArea) : Catch : End Try
  271.             End If
  272.         End If
  273.     End Sub
  274.  
  275.     Private Sub CorrectBounds(ByVal bounds As Rectangle)
  276.         If Parent.Width > bounds.Width Then Parent.Width = bounds.Width
  277.         If Parent.Height > bounds.Height Then Parent.Height = bounds.Height
  278.         Dim X As Integer = Parent.Location.X
  279.         Dim Y As Integer = Parent.Location.Y
  280.         If X < bounds.X Then X = bounds.X
  281.         If Y < bounds.Y Then Y = bounds.Y
  282.         Dim Width As Integer = bounds.X + bounds.Width
  283.         Dim Height As Integer = bounds.Y + bounds.Height
  284.         If X + Parent.Width > Width Then X = Width - Parent.Width
  285.         If Y + Parent.Height > Height Then Y = Height - Parent.Height
  286.         ''Weird allows proper full screen
  287.         '  Parent.Size = New Size(Width, Height)
  288.         If FindForm.WindowState = FormWindowState.Maximized Or FindForm.WindowState = FormWindowState.Minimized Then
  289.             Parent.Size = OldSize
  290.         End If
  291.     End Sub
  292.  
  293.     Protected NotOverridable Overrides Sub OnHandleCreated(ByVal e As EventArgs)
  294.         If Not _LockWidth = 0 Then Width = _LockWidth
  295.         If Not _LockHeight = 0 Then Height = _LockHeight
  296.         If Not _ControlMode Then MyBase.Dock = DockStyle.Fill
  297.     End Sub
  298.  
  299.     Protected NotOverridable Overrides Sub OnParentChanged(ByVal e As EventArgs)
  300.         MyBase.OnParentChanged(e)
  301.         If Parent Is Nothing Then Return
  302.         _IsParentForm = TypeOf Parent Is Form
  303.         If Not _ControlMode Then
  304.             InitializeMessages()
  305.             Parent.BackColor = BackColor
  306.         End If
  307.     End Sub
  308.  
  309. #End Region
  310.  
  311. #Region "Properties"
  312.  
  313.     Enum __CloseChoice
  314.         Form
  315.         Application
  316.     End Enum
  317.     Public Property CloseChoice As __CloseChoice
  318.         Get
  319.             Return _CloseChoice
  320.         End Get
  321.         Set(value As __CloseChoice)
  322.             _CloseChoice = value
  323.         End Set
  324.     End Property
  325.  
  326.     Private _Movable As Boolean = True
  327.     Property Movable() As Boolean
  328.         Get
  329.             Return _Movable
  330.         End Get
  331.         Set(ByVal value As Boolean)
  332.             _Movable = value
  333.         End Set
  334.     End Property
  335.  
  336.     Private _Sizable As Boolean = True
  337.     Property Sizable() As Boolean
  338.         Get
  339.             Return _Sizable
  340.         End Get
  341.         Set(ByVal value As Boolean)
  342.             _Sizable = value
  343.         End Set
  344.     End Property
  345.  
  346.     Private _ControlMode As Boolean
  347.     Protected Property ControlMode() As Boolean
  348.         Get
  349.             Return _ControlMode
  350.         End Get
  351.         Set(ByVal v As Boolean)
  352.             _ControlMode = v
  353.  
  354.             Invalidate()
  355.         End Set
  356.     End Property
  357.  
  358.     Private _SmartBounds As Boolean = True
  359.     Property SmartBounds() As Boolean
  360.         Get
  361.             Return _SmartBounds
  362.         End Get
  363.         Set(ByVal value As Boolean)
  364.             _SmartBounds = value
  365.         End Set
  366.     End Property
  367.  
  368.     Private _IsParentForm As Boolean
  369.     Protected ReadOnly Property IsParentForm As Boolean
  370.         Get
  371.             Return _IsParentForm
  372.         End Get
  373.     End Property
  374.  
  375.     Protected ReadOnly Property IsParentMdi As Boolean
  376.         Get
  377.             If Parent Is Nothing Then Return False
  378.             Return Parent.Parent IsNot Nothing
  379.         End Get
  380.     End Property
  381.  
  382.     <Category("Control")>
  383.     Public Property FontSize As Integer
  384.         Get
  385.             Return _FontSize
  386.         End Get
  387.         Set(value As Integer)
  388.             _FontSize = value
  389.         End Set
  390.     End Property
  391.  
  392.     Private _AllowMinimize As Boolean = True
  393.     <Category("Control")>
  394.     Public Property AllowMinimize As Boolean
  395.         Get
  396.             Return _AllowMinimize
  397.         End Get
  398.         Set(value As Boolean)
  399.             _AllowMinimize = value
  400.         End Set
  401.     End Property
  402.  
  403.     Private _AllowMaximize As Boolean = True
  404.     <Category("Control")>
  405.     Public Property AllowMaximize As Boolean
  406.         Get
  407.             Return _AllowMaximize
  408.         End Get
  409.         Set(value As Boolean)
  410.             _AllowMaximize = value
  411.         End Set
  412.     End Property
  413.  
  414.     Private _ShowIcon As Boolean = True
  415.     <Category("Control")>
  416.     Public Property ShowIcon As Boolean
  417.         Get
  418.             Return _ShowIcon
  419.         End Get
  420.         Set(value As Boolean)
  421.             _ShowIcon = value
  422.             Invalidate()
  423.         End Set
  424.     End Property
  425.  
  426.     Private _AllowClose As Boolean = True
  427.     <Category("Control")>
  428.     Public Property AllowClose As Boolean
  429.         Get
  430.             Return _AllowClose
  431.         End Get
  432.         Set(value As Boolean)
  433.             _AllowClose = value
  434.         End Set
  435.     End Property
  436.  
  437.     <Category("Colours")>
  438.     Public Property BorderColour As Color
  439.         Get
  440.             Return _BorderColour
  441.         End Get
  442.         Set(value As Color)
  443.             _BorderColour = value
  444.         End Set
  445.     End Property
  446.  
  447.     <Category("Colours")>
  448.     Public Property HoverColour As Color
  449.         Get
  450.             Return _HoverColour
  451.         End Get
  452.         Set(value As Color)
  453.             _HoverColour = value
  454.         End Set
  455.     End Property
  456.  
  457.     <Category("Colours")>
  458.     Public Property BaseColour As Color
  459.         Get
  460.             Return _BaseColour
  461.         End Get
  462.         Set(value As Color)
  463.             _BaseColour = value
  464.         End Set
  465.     End Property
  466.  
  467.     <Category("Colours")>
  468.     Public Property ContainerColour As Color
  469.         Get
  470.             Return _ContainerColour
  471.         End Get
  472.         Set(value As Color)
  473.             _ContainerColour = value
  474.         End Set
  475.     End Property
  476.  
  477.     <Category("Colours")>
  478.     Public Property FontColour As Color
  479.         Get
  480.             Return _FontColour
  481.         End Get
  482.         Set(value As Color)
  483.             _FontColour = value
  484.         End Set
  485.     End Property
  486.  
  487. #End Region
  488.  
  489. #Region "Draw Control"
  490.  
  491.     Sub New()
  492.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  493.                 ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer, True)
  494.         Me.DoubleBuffered = True
  495.         Me.BackColor = _BaseColour
  496.         Me.Dock = DockStyle.Fill
  497.     End Sub
  498.  
  499.     Protected Overrides Sub OnCreateControl()
  500.         MyBase.OnCreateControl()
  501.         ParentForm.FormBorderStyle = FormBorderStyle.None
  502.         ParentForm.AllowTransparency = False
  503.         ParentForm.TransparencyKey = Color.Fuchsia
  504.         ParentForm.FindForm.StartPosition = FormStartPosition.CenterScreen
  505.         Dock = DockStyle.Fill
  506.         Invalidate()
  507.     End Sub
  508.  
  509.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  510.  
  511.         Dim G = e.Graphics
  512.         With G
  513.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  514.             .SmoothingMode = SmoothingMode.HighQuality
  515.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  516.             .FillRectangle(New SolidBrush(_BaseColour), New Rectangle(0, 0, Width, Height))
  517.             .FillRectangle(New SolidBrush(_ContainerColour), New Rectangle(2, 35, Width - 4, Height - 37))
  518.             .DrawRectangle(New Pen(_BorderColour), New Rectangle(0, 0, Width, Height))
  519.             Dim ControlBoxPoints() As Point = {New Point(Width - 90, 0), New Point(Width - 90, 22), New Point(Width - 15, 22), New Point(Width - 15, 0)}
  520.             .DrawLines(New Pen(_BorderColour), ControlBoxPoints)
  521.             .DrawLine(New Pen(_BorderColour), Width - 65, 0, Width - 65, 22)
  522.             GetMouseLocation = PointToClient(MousePosition)
  523.             Select Case State
  524.                 Case MouseState.Over
  525.                     If GetMouseLocation.X > Width - 39 AndAlso GetMouseLocation.X < Width - 16 AndAlso GetMouseLocation.Y < 22 Then
  526.                         .FillRectangle(New SolidBrush(_HoverColour), New Rectangle(Width - 39, 0, 23, 22))
  527.                     ElseIf GetMouseLocation.X > Width - 64 AndAlso GetMouseLocation.X < Width - 41 AndAlso GetMouseLocation.Y < 22 Then
  528.                         .FillRectangle(New SolidBrush(_HoverColour), New Rectangle(Width - 64, 0, 23, 22))
  529.                     ElseIf GetMouseLocation.X > Width - 89 AndAlso GetMouseLocation.X < Width - 66 AndAlso GetMouseLocation.Y < 22 Then
  530.                         .FillRectangle(New SolidBrush(_HoverColour), New Rectangle(Width - 89, 0, 23, 22))
  531.                     End If
  532.             End Select
  533.             .DrawLine(New Pen(_BorderColour), Width - 40, 0, Width - 40, 22)
  534.             ''Close Button
  535.             .DrawLine(New Pen(_FontColour, 2), Width - 33, 6, Width - 22, 16)
  536.             .DrawLine(New Pen(_FontColour, 2), Width - 33, 16, Width - 22, 6)
  537.             ''Minimize Button
  538.             .DrawLine(New Pen(_FontColour), Width - 83, 16, Width - 72, 16)
  539.             ''Maximize Button
  540.             .DrawLine(New Pen(_FontColour), Width - 58, 16, Width - 47, 16)
  541.             .DrawLine(New Pen(_FontColour), Width - 58, 16, Width - 58, 6)
  542.             .DrawLine(New Pen(_FontColour), Width - 47, 16, Width - 47, 6)
  543.             .DrawLine(New Pen(_FontColour), Width - 58, 6, Width - 47, 6)
  544.             .DrawLine(New Pen(_FontColour), Width - 58, 7, Width - 47, 7)
  545.             If _ShowIcon Then
  546.                 .DrawIcon(FindForm.Icon, New Rectangle(6, 6, 22, 22))
  547.                 .DrawString(Text, _Font, New SolidBrush(_FontColour), New RectangleF(31, 0, Width - 110, 35), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Near})
  548.             Else
  549.                 .DrawString(Text, _Font, New SolidBrush(_FontColour), New RectangleF(4, 0, Width - 110, 35), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Near})
  550.             End If
  551.             .InterpolationMode = CType(7, InterpolationMode)
  552.         End With
  553.     End Sub
  554.  
  555. #End Region
  556.  
  557. End Class
  558.  
  559. <DefaultEvent("TextChanged")>
  560. Public Class LogInUserTextBox
  561.     Inherits Control
  562.  
  563. #Region "Declarations"
  564.     Private State As MouseState = MouseState.None
  565.     Private WithEvents TB As Windows.Forms.TextBox
  566.     Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
  567.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  568.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  569. #End Region
  570.  
  571. #Region "TextBox Properties"
  572.  
  573.     Private _TextAlign As HorizontalAlignment = HorizontalAlignment.Left
  574.     <Category("Options")>
  575.     Property TextAlign() As HorizontalAlignment
  576.         Get
  577.             Return _TextAlign
  578.         End Get
  579.         Set(ByVal value As HorizontalAlignment)
  580.             _TextAlign = value
  581.             If TB IsNot Nothing Then
  582.                 TB.TextAlign = value
  583.             End If
  584.         End Set
  585.     End Property
  586.     Private _MaxLength As Integer = 32767
  587.     <Category("Options")>
  588.     Property MaxLength() As Integer
  589.         Get
  590.             Return _MaxLength
  591.         End Get
  592.         Set(ByVal value As Integer)
  593.             _MaxLength = value
  594.             If TB IsNot Nothing Then
  595.                 TB.MaxLength = value
  596.             End If
  597.         End Set
  598.     End Property
  599.     Private _ReadOnly As Boolean
  600.     <Category("Options")>
  601.     Property [ReadOnly]() As Boolean
  602.         Get
  603.             Return _ReadOnly
  604.         End Get
  605.         Set(ByVal value As Boolean)
  606.             _ReadOnly = value
  607.             If TB IsNot Nothing Then
  608.                 TB.ReadOnly = value
  609.             End If
  610.         End Set
  611.     End Property
  612.     Private _UseSystemPasswordChar As Boolean
  613.     <Category("Options")>
  614.     Property UseSystemPasswordChar() As Boolean
  615.         Get
  616.             Return _UseSystemPasswordChar
  617.         End Get
  618.         Set(ByVal value As Boolean)
  619.             _UseSystemPasswordChar = value
  620.             If TB IsNot Nothing Then
  621.                 TB.UseSystemPasswordChar = value
  622.             End If
  623.         End Set
  624.     End Property
  625.     Private _Multiline As Boolean
  626.     <Category("Options")>
  627.     Property Multiline() As Boolean
  628.         Get
  629.             Return _Multiline
  630.         End Get
  631.         Set(ByVal value As Boolean)
  632.             _Multiline = value
  633.             If TB IsNot Nothing Then
  634.                 TB.Multiline = value
  635.  
  636.                 If value Then
  637.                     TB.Height = Height - 11
  638.                 Else
  639.                     Height = TB.Height + 11
  640.                 End If
  641.  
  642.             End If
  643.         End Set
  644.     End Property
  645.     <Category("Options")>
  646.     Overrides Property Text As String
  647.         Get
  648.             Return MyBase.Text
  649.         End Get
  650.         Set(ByVal value As String)
  651.             MyBase.Text = value
  652.             If TB IsNot Nothing Then
  653.                 TB.Text = value
  654.             End If
  655.         End Set
  656.     End Property
  657.     <Category("Options")>
  658.     Overrides Property Font As Font
  659.         Get
  660.             Return MyBase.Font
  661.         End Get
  662.         Set(ByVal value As Font)
  663.             MyBase.Font = value
  664.             If TB IsNot Nothing Then
  665.                 TB.Font = value
  666.                 TB.Location = New Point(3, 5)
  667.                 TB.Width = Width - 35
  668.  
  669.                 If Not _Multiline Then
  670.                     Height = TB.Height + 11
  671.                 End If
  672.             End If
  673.         End Set
  674.     End Property
  675.  
  676.     Protected Overrides Sub OnCreateControl()
  677.         MyBase.OnCreateControl()
  678.         If Not Controls.Contains(TB) Then
  679.             Controls.Add(TB)
  680.         End If
  681.     End Sub
  682.     Private Sub OnBaseTextChanged(ByVal s As Object, ByVal e As EventArgs)
  683.         Text = TB.Text
  684.     End Sub
  685.     Private Sub OnBaseKeyDown(ByVal s As Object, ByVal e As KeyEventArgs)
  686.         If e.Control AndAlso e.KeyCode = Keys.A Then
  687.             TB.SelectAll()
  688.             e.SuppressKeyPress = True
  689.         End If
  690.         If e.Control AndAlso e.KeyCode = Keys.C Then
  691.             TB.Copy()
  692.             e.SuppressKeyPress = True
  693.         End If
  694.     End Sub
  695.     Protected Overrides Sub OnResize(ByVal e As EventArgs)
  696.         TB.Location = New Point(5, 5)
  697.         TB.Width = Width - 35
  698.  
  699.         If _Multiline Then
  700.             TB.Height = Height - 11
  701.         Else
  702.             Height = TB.Height + 11
  703.         End If
  704.  
  705.         MyBase.OnResize(e)
  706.     End Sub
  707.  
  708. #End Region
  709.  
  710. #Region "Colour Properties"
  711.  
  712.     <Category("Colours")>
  713.     Public Property BackgroundColour As Color
  714.         Get
  715.             Return _BaseColour
  716.         End Get
  717.         Set(value As Color)
  718.             _BaseColour = value
  719.         End Set
  720.     End Property
  721.  
  722.     <Category("Colours")>
  723.     Public Property TextColour As Color
  724.         Get
  725.             Return _TextColour
  726.         End Get
  727.         Set(value As Color)
  728.             _TextColour = value
  729.         End Set
  730.     End Property
  731.  
  732.     <Category("Colours")>
  733.     Public Property BorderColour As Color
  734.         Get
  735.             Return _BorderColour
  736.         End Get
  737.         Set(value As Color)
  738.             _BorderColour = value
  739.         End Set
  740.     End Property
  741.  
  742. #End Region
  743.  
  744. #Region "Mouse States"
  745.  
  746.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  747.         MyBase.OnMouseDown(e)
  748.         State = MouseState.Down : Invalidate()
  749.     End Sub
  750.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  751.         MyBase.OnMouseUp(e)
  752.         State = MouseState.Over : TB.Focus() : Invalidate()
  753.     End Sub
  754.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  755.         MyBase.OnMouseLeave(e)
  756.         State = MouseState.None : Invalidate()
  757.     End Sub
  758.  
  759. #End Region
  760.  
  761. #Region "Draw Control"
  762.     Sub New()
  763.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  764.                  ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  765.                  ControlStyles.SupportsTransparentBackColor, True)
  766.         DoubleBuffered = True
  767.         BackColor = Color.Transparent
  768.         TB = New Windows.Forms.TextBox
  769.         TB.Height = 190
  770.         TB.Font = New Font("Segoe UI", 10)
  771.         TB.Text = Text
  772.         TB.BackColor = Color.FromArgb(42, 42, 42)
  773.         TB.ForeColor = Color.FromArgb(255, 255, 255)
  774.         TB.MaxLength = _MaxLength
  775.         TB.Multiline = False
  776.         TB.ReadOnly = _ReadOnly
  777.         TB.UseSystemPasswordChar = _UseSystemPasswordChar
  778.         TB.BorderStyle = BorderStyle.None
  779.         TB.Location = New Point(5, 5)
  780.         TB.Width = Width - 35
  781.         AddHandler TB.TextChanged, AddressOf OnBaseTextChanged
  782.         AddHandler TB.KeyDown, AddressOf OnBaseKeyDown
  783.     End Sub
  784.  
  785.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  786.  
  787.         Dim G = e.Graphics
  788.         Dim GP As GraphicsPath
  789.         Dim Base As New Rectangle(0, 0, Width, Height)
  790.         With G
  791.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  792.             .SmoothingMode = SmoothingMode.HighQuality
  793.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  794.             .Clear(BackColor)
  795.             TB.BackColor = Color.FromArgb(42, 42, 42)
  796.             TB.ForeColor = Color.FromArgb(255, 255, 255)
  797.             GP = RoundRectangle(Base, 6)
  798.             .FillPath(New SolidBrush(Color.FromArgb(42, 42, 42)), GP)
  799.             .DrawPath(New Pen(New SolidBrush(Color.FromArgb(35, 35, 35)), 2), GP)
  800.             GP.Dispose()
  801.             .FillPie(New SolidBrush(FindForm.BackColor), New Rectangle(Width - 25, Height - 23, Height + 25, Height + 25), 180, 90)
  802.             .DrawPie(New Pen(Color.FromArgb(35, 35, 35), 2), New Rectangle(Width - 25, Height - 23, Height + 25, Height + 25), 180, 90)
  803.             .InterpolationMode = CType(7, InterpolationMode)
  804.         End With
  805.     End Sub
  806.  
  807.  
  808.  
  809. #End Region
  810.  
  811. End Class
  812.  
  813. <DefaultEvent("TextChanged")>
  814. Public Class LogInPassTextBox
  815.     Inherits Control
  816.  
  817. #Region "Declarations"
  818.     Private State As MouseState = MouseState.None
  819.     Private WithEvents TB As Windows.Forms.TextBox
  820.     Private _BaseColour As Color = Color.FromArgb(255, 255, 255)
  821.     Private _TextColour As Color = Color.FromArgb(50, 50, 50)
  822.     Private _BorderColour As Color = Color.FromArgb(180, 187, 205)
  823. #End Region
  824.  
  825. #Region "TextBox Properties"
  826.  
  827.     Private _TextAlign As HorizontalAlignment = HorizontalAlignment.Left
  828.     <Category("Options")>
  829.     Property TextAlign() As HorizontalAlignment
  830.         Get
  831.             Return _TextAlign
  832.         End Get
  833.         Set(ByVal value As HorizontalAlignment)
  834.             _TextAlign = value
  835.             If TB IsNot Nothing Then
  836.                 TB.TextAlign = value
  837.             End If
  838.         End Set
  839.     End Property
  840.     Private _MaxLength As Integer = 32767
  841.     <Category("Options")>
  842.     Property MaxLength() As Integer
  843.         Get
  844.             Return _MaxLength
  845.         End Get
  846.         Set(ByVal value As Integer)
  847.             _MaxLength = value
  848.             If TB IsNot Nothing Then
  849.                 TB.MaxLength = value
  850.             End If
  851.         End Set
  852.     End Property
  853.     Private _ReadOnly As Boolean
  854.     <Category("Options")>
  855.     Property [ReadOnly]() As Boolean
  856.         Get
  857.             Return _ReadOnly
  858.         End Get
  859.         Set(ByVal value As Boolean)
  860.             _ReadOnly = value
  861.             If TB IsNot Nothing Then
  862.                 TB.ReadOnly = value
  863.             End If
  864.         End Set
  865.     End Property
  866.     Private _UseSystemPasswordChar As Boolean
  867.     <Category("Options")>
  868.     Property UseSystemPasswordChar() As Boolean
  869.         Get
  870.             Return _UseSystemPasswordChar
  871.         End Get
  872.         Set(ByVal value As Boolean)
  873.             _UseSystemPasswordChar = value
  874.             If TB IsNot Nothing Then
  875.                 TB.UseSystemPasswordChar = value
  876.             End If
  877.         End Set
  878.     End Property
  879.     Private _Multiline As Boolean
  880.     <Category("Options")>
  881.     Property Multiline() As Boolean
  882.         Get
  883.             Return _Multiline
  884.         End Get
  885.         Set(ByVal value As Boolean)
  886.             _Multiline = value
  887.             If TB IsNot Nothing Then
  888.                 TB.Multiline = value
  889.  
  890.                 If value Then
  891.                     TB.Height = Height - 11
  892.                 Else
  893.                     Height = TB.Height + 11
  894.                 End If
  895.  
  896.             End If
  897.         End Set
  898.     End Property
  899.     <Category("Options")>
  900.     Overrides Property Text As String
  901.         Get
  902.             Return MyBase.Text
  903.         End Get
  904.         Set(ByVal value As String)
  905.             MyBase.Text = value
  906.             If TB IsNot Nothing Then
  907.                 TB.Text = value
  908.             End If
  909.         End Set
  910.     End Property
  911.     <Category("Options")>
  912.     Overrides Property Font As Font
  913.         Get
  914.             Return MyBase.Font
  915.         End Get
  916.         Set(ByVal value As Font)
  917.             MyBase.Font = value
  918.             If TB IsNot Nothing Then
  919.                 TB.Font = value
  920.                 TB.Location = New Point(3, 5)
  921.                 TB.Width = Width - 35
  922.  
  923.                 If Not _Multiline Then
  924.                     Height = TB.Height + 11
  925.                 End If
  926.             End If
  927.         End Set
  928.     End Property
  929.  
  930.     Protected Overrides Sub OnCreateControl()
  931.         MyBase.OnCreateControl()
  932.         If Not Controls.Contains(TB) Then
  933.             Controls.Add(TB)
  934.         End If
  935.     End Sub
  936.     Private Sub OnBaseTextChanged(ByVal s As Object, ByVal e As EventArgs)
  937.         Text = TB.Text
  938.     End Sub
  939.     Private Sub OnBaseKeyDown(ByVal s As Object, ByVal e As KeyEventArgs)
  940.         If e.Control AndAlso e.KeyCode = Keys.A Then
  941.             TB.SelectAll()
  942.             e.SuppressKeyPress = True
  943.         End If
  944.         If e.Control AndAlso e.KeyCode = Keys.C Then
  945.             TB.Copy()
  946.             e.SuppressKeyPress = True
  947.         End If
  948.     End Sub
  949.     Protected Overrides Sub OnResize(ByVal e As EventArgs)
  950.         TB.Location = New Point(5, 5)
  951.         TB.Width = Width - 35
  952.  
  953.         If _Multiline Then
  954.             TB.Height = Height - 11
  955.         Else
  956.             Height = TB.Height + 11
  957.         End If
  958.  
  959.         MyBase.OnResize(e)
  960.     End Sub
  961. #End Region
  962.  
  963. #Region "Colour Properties"
  964.  
  965.     <Category("Colours")>
  966.     Public Property BackgroundColour As Color
  967.         Get
  968.             Return _BaseColour
  969.         End Get
  970.         Set(value As Color)
  971.             _BaseColour = value
  972.         End Set
  973.     End Property
  974.  
  975.     <Category("Colours")>
  976.     Public Property TextColour As Color
  977.         Get
  978.             Return _TextColour
  979.         End Get
  980.         Set(value As Color)
  981.             _TextColour = value
  982.         End Set
  983.     End Property
  984.  
  985.     <Category("Colours")>
  986.     Public Property BorderColour As Color
  987.         Get
  988.             Return _BorderColour
  989.         End Get
  990.         Set(value As Color)
  991.             _BorderColour = value
  992.         End Set
  993.     End Property
  994.  
  995. #End Region
  996.  
  997. #Region "Mouse States"
  998.  
  999.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  1000.         MyBase.OnMouseDown(e)
  1001.         State = MouseState.Down : Invalidate()
  1002.     End Sub
  1003.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  1004.         MyBase.OnMouseUp(e)
  1005.         State = MouseState.Over : TB.Focus() : Invalidate()
  1006.     End Sub
  1007.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  1008.         MyBase.OnMouseLeave(e)
  1009.         State = MouseState.None : Invalidate()
  1010.     End Sub
  1011.  
  1012. #End Region
  1013.  
  1014. #Region "Draw Control"
  1015.     Sub New()
  1016.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  1017.                  ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  1018.                  ControlStyles.SupportsTransparentBackColor, True)
  1019.         DoubleBuffered = True
  1020.         BackColor = Color.Transparent
  1021.         TB = New Windows.Forms.TextBox
  1022.         TB.Height = 190
  1023.         TB.Font = New Font("Segoe UI", 10)
  1024.         TB.Text = Text
  1025.         TB.BackColor = Color.FromArgb(42, 42, 42)
  1026.         TB.ForeColor = Color.FromArgb(255, 255, 255)
  1027.         TB.MaxLength = _MaxLength
  1028.         TB.Multiline = False
  1029.         TB.ReadOnly = _ReadOnly
  1030.         TB.UseSystemPasswordChar = _UseSystemPasswordChar
  1031.         TB.BorderStyle = BorderStyle.None
  1032.         TB.Location = New Point(5, 5)
  1033.         TB.Width = Width - 35
  1034.         AddHandler TB.TextChanged, AddressOf OnBaseTextChanged
  1035.         AddHandler TB.KeyDown, AddressOf OnBaseKeyDown
  1036.     End Sub
  1037.  
  1038.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  1039.         Dim G = e.Graphics
  1040.         Dim GP As GraphicsPath
  1041.         Dim Base As New Rectangle(0, 0, Width, Height)
  1042.         With G
  1043.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  1044.             .SmoothingMode = SmoothingMode.HighQuality
  1045.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  1046.             .Clear(BackColor)
  1047.             TB.BackColor = Color.FromArgb(42, 42, 42)
  1048.             TB.ForeColor = Color.FromArgb(255, 255, 255)
  1049.             GP = RoundRectangle(Base, 6)
  1050.             .FillPath(New SolidBrush(Color.FromArgb(42, 42, 42)), GP)
  1051.             .DrawPath(New Pen(New SolidBrush(Color.FromArgb(35, 35, 35)), 2), GP)
  1052.             GP.Dispose()
  1053.             .FillPie(New SolidBrush(FindForm.BackColor), New Rectangle(Width - 25, Height - 60, Height + 25, Height + 25), 90, 90)
  1054.             .DrawPie(New Pen(Color.FromArgb(35, 35, 35), 2), New Rectangle(Width - 25, Height - 60, Height + 25, Height + 25), 90, 90)
  1055.             .FillEllipse(New SolidBrush(_TextColour), New Rectangle(10, 5, 10, 7))
  1056.             .InterpolationMode = CType(7, InterpolationMode)
  1057.         End With
  1058.     End Sub
  1059. #End Region
  1060.  
  1061. End Class
  1062.  
  1063. Public Class LogInLogButton
  1064.     Inherits Control
  1065.  
  1066. #Region "Declarations"
  1067.     Private State As MouseState = MouseState.None
  1068.     Private _ArcColour As Color = Color.FromArgb(43, 43, 43)
  1069.     Private _ArrowColour As Color = Color.FromArgb(235, 233, 234)
  1070.     Private _ArrowBorderColour As Color = Color.FromArgb(170, 170, 170)
  1071.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  1072.     Private _HoverColour As Color = Color.FromArgb(0, 130, 169)
  1073.     Private _PressedColour As Color = Color.FromArgb(0, 145, 184)
  1074.     Private _NormalColour As Color = Color.FromArgb(0, 160, 199)
  1075. #End Region
  1076.  
  1077. #Region "Mouse States"
  1078.  
  1079.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  1080.         MyBase.OnMouseDown(e)
  1081.         State = MouseState.Down : Invalidate()
  1082.     End Sub
  1083.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  1084.         MyBase.OnMouseUp(e)
  1085.         State = MouseState.Over : Invalidate()
  1086.     End Sub
  1087.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  1088.         MyBase.OnMouseEnter(e)
  1089.         State = MouseState.Over : Invalidate()
  1090.     End Sub
  1091.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  1092.         MyBase.OnMouseLeave(e)
  1093.         State = MouseState.None : Invalidate()
  1094.     End Sub
  1095.  
  1096. #End Region
  1097.  
  1098. #Region "Colour Properties"
  1099.     <Category("Colours")>
  1100.     Public Property ArcColour As Color
  1101.         Get
  1102.             Return _ArcColour
  1103.         End Get
  1104.         Set(value As Color)
  1105.             _ArcColour = value
  1106.         End Set
  1107.     End Property
  1108.     <Category("Colours")>
  1109.     Public Property BorderColour As Color
  1110.         Get
  1111.             Return _BorderColour
  1112.         End Get
  1113.         Set(value As Color)
  1114.             _BorderColour = value
  1115.         End Set
  1116.     End Property
  1117.     <Category("Colours")>
  1118.     Public Property ArrowColour As Color
  1119.         Get
  1120.             Return _ArrowColour
  1121.         End Get
  1122.         Set(value As Color)
  1123.             _ArrowColour = value
  1124.         End Set
  1125.     End Property
  1126.     <Category("Colours")>
  1127.     Public Property ArrowBorderColour As Color
  1128.         Get
  1129.             Return _ArrowBorderColour
  1130.         End Get
  1131.         Set(value As Color)
  1132.             _ArrowBorderColour = value
  1133.         End Set
  1134.     End Property
  1135.     <Category("Colours")>
  1136.     Public Property HoverColour As Color
  1137.         Get
  1138.             Return _HoverColour
  1139.         End Get
  1140.         Set(value As Color)
  1141.             _HoverColour = value
  1142.         End Set
  1143.     End Property
  1144.     <Category("Colours")>
  1145.     Public Property PressedColour As Color
  1146.         Get
  1147.             Return _PressedColour
  1148.         End Get
  1149.         Set(value As Color)
  1150.             _PressedColour = value
  1151.         End Set
  1152.     End Property
  1153.     <Category("Colours")>
  1154.     Public Property NormalColour As Color
  1155.         Get
  1156.             Return _NormalColour
  1157.         End Get
  1158.         Set(value As Color)
  1159.             _NormalColour = value
  1160.         End Set
  1161.     End Property
  1162.  
  1163.     Protected Overrides Sub OnResize(e As EventArgs)
  1164.         MyBase.OnResize(e)
  1165.         Size = New Size(50, 50)
  1166.     End Sub
  1167.  
  1168. #End Region
  1169.  
  1170. #Region "Draw Control"
  1171.  
  1172.     Sub New()
  1173.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  1174.                 ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  1175.                 ControlStyles.SupportsTransparentBackColor, True)
  1176.         DoubleBuffered = True
  1177.         Size = New Size(50, 50)
  1178.         BackColor = Color.FromArgb(54, 54, 54)
  1179.     End Sub
  1180.  
  1181.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  1182.  
  1183.         Dim G = e.Graphics
  1184.         Dim GP, GP1 As New GraphicsPath
  1185.         With G
  1186.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  1187.             .SmoothingMode = SmoothingMode.HighQuality
  1188.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  1189.             .Clear(BackColor)
  1190.             Dim P() As Point = {New Point(18, 22), New Point(28, 22), New Point(28, 18), New Point(34, 25), New Point(28, 32), New Point(28, 28), New Point(18, 28)}
  1191.             Select Case State
  1192.                 Case MouseState.None
  1193.                     .FillEllipse(New SolidBrush(Color.FromArgb(56, 56, 56)), New Rectangle(CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 3, Height - 3 - 3))
  1194.                     .DrawArc(New Pen(New SolidBrush(_ArcColour), 1 + 3), CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 3, Height - 3 - 3, -90, 360)
  1195.                     .DrawEllipse(New Pen(_BorderColour), New Rectangle(1, 1, Height - 3, Height - 3))
  1196.                     .FillEllipse(New SolidBrush(_NormalColour), New Rectangle(CInt(3 / 2) + 3, CInt(3 / 2) + 3, Height - 11, Height - 11))
  1197.                     .FillPolygon(New SolidBrush(_ArrowColour), P)
  1198.                     .DrawPolygon(New Pen(_ArrowBorderColour), P)
  1199.                 Case MouseState.Over
  1200.                     .DrawArc(New Pen(New SolidBrush(_ArcColour), 1 + 3), CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 3, Height - 3 - 3, -90, 360)
  1201.                     .DrawEllipse(New Pen(_BorderColour), New Rectangle(1, 1, Height - 3, Height - 3))
  1202.                     .FillEllipse(New SolidBrush(_HoverColour), New Rectangle(6, 6, Height - 13, Height - 13))
  1203.                     .FillPolygon(New SolidBrush(_ArrowColour), P)
  1204.                     .DrawPolygon(New Pen(_ArrowBorderColour), P)
  1205.                 Case MouseState.Down
  1206.                     .DrawArc(New Pen(New SolidBrush(_ArcColour), 1 + 3), CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 3, Height - 3 - 3, -90, 360)
  1207.                     .DrawEllipse(New Pen(_BorderColour), New Rectangle(1, 1, Height - 3, Height - 3))
  1208.                     .FillEllipse(New SolidBrush(_PressedColour), New Rectangle(6, 6, Height - 13, Height - 13))
  1209.                     .FillPolygon(New SolidBrush(_ArrowColour), P)
  1210.                     .DrawPolygon(New Pen(_ArrowBorderColour), P)
  1211.             End Select
  1212.             GP.Dispose()
  1213.             GP1.Dispose()
  1214.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  1215.         End With
  1216.     End Sub
  1217.  
  1218. #End Region
  1219.  
  1220. End Class
  1221.  
  1222. <DefaultEvent("CheckedChanged")>
  1223. Public Class LogInCheckBox
  1224.     Inherits Control
  1225.  
  1226. #Region "Declarations"
  1227.     Private _Checked As Boolean
  1228.     Private State As MouseState = MouseState.None
  1229.     Private _CheckedColour As Color = Color.FromArgb(173, 173, 174)
  1230.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  1231.     Private _BackColour As Color = Color.FromArgb(42, 42, 42)
  1232.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  1233. #End Region
  1234.  
  1235. #Region "Colour & Other Properties"
  1236.  
  1237.     <Category("Colours")>
  1238.     Public Property BaseColour As Color
  1239.         Get
  1240.             Return _BackColour
  1241.         End Get
  1242.         Set(value As Color)
  1243.             _BackColour = value
  1244.         End Set
  1245.     End Property
  1246.  
  1247.     <Category("Colours")>
  1248.     Public Property BorderColour As Color
  1249.         Get
  1250.             Return _BorderColour
  1251.         End Get
  1252.         Set(value As Color)
  1253.             _BorderColour = value
  1254.         End Set
  1255.     End Property
  1256.  
  1257.     <Category("Colours")>
  1258.     Public Property CheckedColour As Color
  1259.         Get
  1260.             Return _CheckedColour
  1261.         End Get
  1262.         Set(value As Color)
  1263.             _CheckedColour = value
  1264.         End Set
  1265.     End Property
  1266.  
  1267.     <Category("Colours")>
  1268.     Public Property FontColour As Color
  1269.         Get
  1270.             Return _TextColour
  1271.         End Get
  1272.         Set(value As Color)
  1273.             _TextColour = value
  1274.         End Set
  1275.     End Property
  1276.  
  1277.     Protected Overrides Sub OnTextChanged(ByVal e As EventArgs)
  1278.         MyBase.OnTextChanged(e)
  1279.         Invalidate()
  1280.     End Sub
  1281.  
  1282.     Property Checked() As Boolean
  1283.         Get
  1284.             Return _Checked
  1285.         End Get
  1286.         Set(ByVal value As Boolean)
  1287.             _Checked = value
  1288.             Invalidate()
  1289.         End Set
  1290.     End Property
  1291.  
  1292.     Event CheckedChanged(ByVal sender As Object)
  1293.     Protected Overrides Sub OnClick(ByVal e As EventArgs)
  1294.         _Checked = Not _Checked
  1295.         RaiseEvent CheckedChanged(Me)
  1296.         MyBase.OnClick(e)
  1297.     End Sub
  1298.  
  1299.     Protected Overrides Sub OnResize(e As EventArgs)
  1300.         MyBase.OnResize(e)
  1301.         Height = 22
  1302.     End Sub
  1303. #End Region
  1304.  
  1305. #Region "Mouse States"
  1306.  
  1307.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  1308.         MyBase.OnMouseDown(e)
  1309.         State = MouseState.Down : Invalidate()
  1310.     End Sub
  1311.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  1312.         MyBase.OnMouseUp(e)
  1313.         State = MouseState.Over : Invalidate()
  1314.     End Sub
  1315.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  1316.         MyBase.OnMouseEnter(e)
  1317.         State = MouseState.Over : Invalidate()
  1318.     End Sub
  1319.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  1320.         MyBase.OnMouseLeave(e)
  1321.         State = MouseState.None : Invalidate()
  1322.     End Sub
  1323.  
  1324. #End Region
  1325.  
  1326. #Region "Draw Control"
  1327.     Sub New()
  1328.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  1329.                    ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.SupportsTransparentBackColor, True)
  1330.         DoubleBuffered = True
  1331.         Cursor = Cursors.Hand
  1332.         Size = New Size(100, 22)
  1333.     End Sub
  1334.  
  1335.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  1336.         Dim g = e.Graphics
  1337.         Dim Base As New Rectangle(0, 0, 20, 20)
  1338.         With G
  1339.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  1340.             .SmoothingMode = SmoothingMode.HighQuality
  1341.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  1342.             .Clear(Color.FromArgb(54, 54, 54))
  1343.             .FillRectangle(New SolidBrush(_BackColour), Base)
  1344.             .DrawRectangle(New Pen(_BorderColour), New Rectangle(1, 1, 18, 18))
  1345.             Select Case State
  1346.                 Case MouseState.Over
  1347.                     .FillRectangle(New SolidBrush(Color.FromArgb(50, 49, 51)), Base)
  1348.                     .DrawRectangle(New Pen(_BorderColour), New Rectangle(1, 1, 18, 18))
  1349.             End Select
  1350.             If Checked Then
  1351.                 Dim P() As Point = {New Point(4, 11), New Point(6, 8), New Point(9, 12), New Point(15, 3), New Point(17, 6), New Point(9, 16)}
  1352.                 .FillPolygon(New SolidBrush(_CheckedColour), P)
  1353.             End If
  1354.             .DrawString(Text, Font, New SolidBrush(_TextColour), New Rectangle(24, 1, Width, Height - 2), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center})
  1355.             .InterpolationMode = CType(7, InterpolationMode)
  1356.         End With
  1357.     End Sub
  1358. #End Region
  1359.  
  1360. End Class
  1361.  
  1362. Public Class LogInNormalTextBox
  1363.     Inherits Control
  1364.  
  1365. #Region "Declarations"
  1366.     Private State As MouseState = MouseState.None
  1367.     Private WithEvents TB As Windows.Forms.TextBox
  1368.     Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
  1369.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  1370.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  1371.     Private _Style As Styles = Styles.NotRounded
  1372.     Private _TextAlign As HorizontalAlignment = HorizontalAlignment.Left
  1373.     Private _MaxLength As Integer = 32767
  1374.     Private _ReadOnly As Boolean
  1375.     Private _UseSystemPasswordChar As Boolean
  1376.     Private _Multiline As Boolean
  1377. #End Region
  1378.  
  1379. #Region "TextBox Properties"
  1380.  
  1381.     Enum Styles
  1382.         Rounded
  1383.         NotRounded
  1384.     End Enum
  1385.  
  1386.     <Category("Options")>
  1387.     Property TextAlign() As HorizontalAlignment
  1388.         Get
  1389.             Return _TextAlign
  1390.         End Get
  1391.         Set(ByVal value As HorizontalAlignment)
  1392.             _TextAlign = value
  1393.             If TB IsNot Nothing Then
  1394.                 TB.TextAlign = value
  1395.             End If
  1396.         End Set
  1397.     End Property
  1398.  
  1399.     <Category("Options")>
  1400.     Property MaxLength() As Integer
  1401.         Get
  1402.             Return _MaxLength
  1403.         End Get
  1404.         Set(ByVal value As Integer)
  1405.             _MaxLength = value
  1406.             If TB IsNot Nothing Then
  1407.                 TB.MaxLength = value
  1408.             End If
  1409.         End Set
  1410.     End Property
  1411.  
  1412.     <Category("Options")>
  1413.     Property [ReadOnly]() As Boolean
  1414.         Get
  1415.             Return _ReadOnly
  1416.         End Get
  1417.         Set(ByVal value As Boolean)
  1418.             _ReadOnly = value
  1419.             If TB IsNot Nothing Then
  1420.                 TB.ReadOnly = value
  1421.             End If
  1422.         End Set
  1423.     End Property
  1424.  
  1425.     <Category("Options")>
  1426.     Property UseSystemPasswordChar() As Boolean
  1427.         Get
  1428.             Return _UseSystemPasswordChar
  1429.         End Get
  1430.         Set(ByVal value As Boolean)
  1431.             _UseSystemPasswordChar = value
  1432.             If TB IsNot Nothing Then
  1433.                 TB.UseSystemPasswordChar = value
  1434.             End If
  1435.         End Set
  1436.     End Property
  1437.  
  1438.     <Category("Options")>
  1439.     Property Multiline() As Boolean
  1440.         Get
  1441.             Return _Multiline
  1442.         End Get
  1443.         Set(ByVal value As Boolean)
  1444.             _Multiline = value
  1445.             If TB IsNot Nothing Then
  1446.                 TB.Multiline = value
  1447.  
  1448.                 If value Then
  1449.                     TB.Height = Height - 11
  1450.                 Else
  1451.                     Height = TB.Height + 11
  1452.                 End If
  1453.  
  1454.             End If
  1455.         End Set
  1456.     End Property
  1457.  
  1458.     <Category("Options")>
  1459.     Overrides Property Text As String
  1460.         Get
  1461.             Return MyBase.Text
  1462.         End Get
  1463.         Set(ByVal value As String)
  1464.             MyBase.Text = value
  1465.             If TB IsNot Nothing Then
  1466.                 TB.Text = value
  1467.             End If
  1468.         End Set
  1469.     End Property
  1470.  
  1471.     <Category("Options")>
  1472.     Overrides Property Font As Font
  1473.         Get
  1474.             Return MyBase.Font
  1475.         End Get
  1476.         Set(ByVal value As Font)
  1477.             MyBase.Font = value
  1478.             If TB IsNot Nothing Then
  1479.                 TB.Font = value
  1480.                 TB.Location = New Point(3, 5)
  1481.                 TB.Width = Width - 6
  1482.  
  1483.                 If Not _Multiline Then
  1484.                     Height = TB.Height + 11
  1485.                 End If
  1486.             End If
  1487.         End Set
  1488.     End Property
  1489.  
  1490.     Protected Overrides Sub OnCreateControl()
  1491.         MyBase.OnCreateControl()
  1492.         If Not Controls.Contains(TB) Then
  1493.             Controls.Add(TB)
  1494.         End If
  1495.     End Sub
  1496.  
  1497.     Private Sub OnBaseTextChanged(ByVal s As Object, ByVal e As EventArgs)
  1498.         Text = TB.Text
  1499.     End Sub
  1500.  
  1501.     Private Sub OnBaseKeyDown(ByVal s As Object, ByVal e As KeyEventArgs)
  1502.         If e.Control AndAlso e.KeyCode = Keys.A Then
  1503.             TB.SelectAll()
  1504.             e.SuppressKeyPress = True
  1505.         End If
  1506.         If e.Control AndAlso e.KeyCode = Keys.C Then
  1507.             TB.Copy()
  1508.             e.SuppressKeyPress = True
  1509.         End If
  1510.     End Sub
  1511.  
  1512.     Protected Overrides Sub OnResize(ByVal e As EventArgs)
  1513.         TB.Location = New Point(5, 5)
  1514.         TB.Width = Width - 10
  1515.  
  1516.         If _Multiline Then
  1517.             TB.Height = Height - 11
  1518.         Else
  1519.             Height = TB.Height + 11
  1520.         End If
  1521.  
  1522.         MyBase.OnResize(e)
  1523.     End Sub
  1524.  
  1525.     Public Property Style As Styles
  1526.         Get
  1527.             Return _Style
  1528.         End Get
  1529.         Set(value As Styles)
  1530.             _Style = value
  1531.         End Set
  1532.     End Property
  1533.  
  1534.     Public Sub SelectAll()
  1535.         TB.Focus()
  1536.         TB.SelectAll()
  1537.     End Sub
  1538.  
  1539.  
  1540. #End Region
  1541.  
  1542. #Region "Colour Properties"
  1543.  
  1544.     <Category("Colours")>
  1545.     Public Property BackgroundColour As Color
  1546.         Get
  1547.             Return _BaseColour
  1548.         End Get
  1549.         Set(value As Color)
  1550.             _BaseColour = value
  1551.         End Set
  1552.     End Property
  1553.  
  1554.     <Category("Colours")>
  1555.     Public Property TextColour As Color
  1556.         Get
  1557.             Return _TextColour
  1558.         End Get
  1559.         Set(value As Color)
  1560.             _TextColour = value
  1561.         End Set
  1562.     End Property
  1563.  
  1564.     <Category("Colours")>
  1565.     Public Property BorderColour As Color
  1566.         Get
  1567.             Return _BorderColour
  1568.         End Get
  1569.         Set(value As Color)
  1570.             _BorderColour = value
  1571.         End Set
  1572.     End Property
  1573.  
  1574. #End Region
  1575.  
  1576. #Region "Mouse States"
  1577.  
  1578.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  1579.         MyBase.OnMouseDown(e)
  1580.         State = MouseState.Down : Invalidate()
  1581.     End Sub
  1582.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  1583.         MyBase.OnMouseUp(e)
  1584.         State = MouseState.Over : TB.Focus() : Invalidate()
  1585.     End Sub
  1586.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  1587.         MyBase.OnMouseLeave(e)
  1588.         State = MouseState.None : Invalidate()
  1589.     End Sub
  1590.  
  1591. #End Region
  1592.  
  1593. #Region "Draw Control"
  1594.     Sub New()
  1595.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  1596.                  ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  1597.                  ControlStyles.SupportsTransparentBackColor, True)
  1598.         DoubleBuffered = True
  1599.         BackColor = Color.Transparent
  1600.         TB = New Windows.Forms.TextBox
  1601.         TB.Height = 190
  1602.         TB.Font = New Font("Segoe UI", 10)
  1603.         TB.Text = Text
  1604.         TB.BackColor = Color.FromArgb(42, 42, 42)
  1605.         TB.ForeColor = Color.FromArgb(255, 255, 255)
  1606.         TB.MaxLength = _MaxLength
  1607.         TB.Multiline = False
  1608.         TB.ReadOnly = _ReadOnly
  1609.         TB.UseSystemPasswordChar = _UseSystemPasswordChar
  1610.         TB.BorderStyle = BorderStyle.None
  1611.         TB.Location = New Point(5, 5)
  1612.         TB.Width = Width - 35
  1613.         AddHandler TB.TextChanged, AddressOf OnBaseTextChanged
  1614.         AddHandler TB.KeyDown, AddressOf OnBaseKeyDown
  1615.     End Sub
  1616.  
  1617.  
  1618.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  1619.         Dim g = e.Graphics
  1620.         Dim GP As GraphicsPath
  1621.         Dim Base As New Rectangle(0, 0, Width, Height)
  1622.         With g
  1623.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  1624.             .SmoothingMode = SmoothingMode.HighQuality
  1625.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  1626.             .Clear(BackColor)
  1627.             TB.BackColor = Color.FromArgb(42, 42, 42)
  1628.             TB.ForeColor = Color.FromArgb(255, 255, 255)
  1629.             Select Case _Style
  1630.                 Case Styles.Rounded
  1631.                     GP = RoundRectangle(Base, 6)
  1632.                     .FillPath(New SolidBrush(Color.FromArgb(42, 42, 42)), GP)
  1633.                     .DrawPath(New Pen(New SolidBrush(Color.FromArgb(35, 35, 35)), 2), GP)
  1634.                     GP.Dispose()
  1635.                 Case Styles.NotRounded
  1636.                     .FillRectangle(New SolidBrush(Color.FromArgb(42, 42, 42)), New Rectangle(0, 0, Width - 1, Height - 1))
  1637.                     .DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(35, 35, 35)), 2), New Rectangle(0, 0, Width, Height))
  1638.             End Select
  1639.             .InterpolationMode = CType(7, InterpolationMode)
  1640.         End With
  1641.     End Sub
  1642.  
  1643. #End Region
  1644.  
  1645. End Class
  1646.  
  1647. Public Class LogInRadialProgressBar
  1648.     Inherits Control
  1649.  
  1650. #Region "Declarations"
  1651.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  1652.     Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
  1653.     Private _ProgressColour As Color = Color.FromArgb(23, 119, 151)
  1654.     Private _Value As Integer = 0
  1655.     Private _Maximum As Integer = 100
  1656.     Private _StartingAngle As Integer = 110
  1657.     Private _RotationAngle As Integer = 255
  1658.     Private ReadOnly _Font As Font = New Font("Segoe UI", 20)
  1659. #End Region
  1660.  
  1661. #Region "Properties"
  1662.  
  1663.     <Category("Control")>
  1664.     Public Property Maximum() As Integer
  1665.         Get
  1666.             Return _Maximum
  1667.         End Get
  1668.         Set(V As Integer)
  1669.             Select Case V
  1670.                 Case Is < _Value
  1671.                     _Value = V
  1672.             End Select
  1673.             _Maximum = V
  1674.             Invalidate()
  1675.         End Set
  1676.     End Property
  1677.  
  1678.     <Category("Control")>
  1679.     Public Property Value() As Integer
  1680.         Get
  1681.             Select Case _Value
  1682.                 Case 0
  1683.                     Return 0
  1684.                 Case Else
  1685.                     Return _Value
  1686.             End Select
  1687.         End Get
  1688.  
  1689.         Set(V As Integer)
  1690.             Select Case V
  1691.                 Case Is > _Maximum
  1692.                     V = _Maximum
  1693.                     Invalidate()
  1694.             End Select
  1695.             _Value = V
  1696.             Invalidate()
  1697.         End Set
  1698.     End Property
  1699.  
  1700.     Public Sub Increment(ByVal Amount As Integer)
  1701.         Value += Amount
  1702.     End Sub
  1703.  
  1704.     <Category("Colours")>
  1705.     Public Property BorderColour As Color
  1706.         Get
  1707.             Return _BorderColour
  1708.         End Get
  1709.         Set(value As Color)
  1710.             _BorderColour = value
  1711.         End Set
  1712.     End Property
  1713.  
  1714.     <Category("Colours")>
  1715.     Public Property ProgressColour As Color
  1716.         Get
  1717.             Return _ProgressColour
  1718.         End Get
  1719.         Set(value As Color)
  1720.             _ProgressColour = value
  1721.         End Set
  1722.     End Property
  1723.  
  1724.     <Category("Colours")>
  1725.     Public Property BaseColour As Color
  1726.         Get
  1727.             Return _BaseColour
  1728.         End Get
  1729.         Set(value As Color)
  1730.             _BaseColour = value
  1731.         End Set
  1732.     End Property
  1733.  
  1734.     <Category("Control")>
  1735.     Public Property StartingAngle As Integer
  1736.         Get
  1737.             Return _StartingAngle
  1738.         End Get
  1739.         Set(value As Integer)
  1740.             _StartingAngle = value
  1741.         End Set
  1742.     End Property
  1743.  
  1744.     <Category("Control")>
  1745.     Public Property RotationAngle As Integer
  1746.         Get
  1747.             Return _RotationAngle
  1748.         End Get
  1749.         Set(value As Integer)
  1750.             _RotationAngle = value
  1751.         End Set
  1752.     End Property
  1753.  
  1754. #End Region
  1755.  
  1756. #Region "Draw Control"
  1757.     Sub New()
  1758.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  1759.                 ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  1760.                 ControlStyles.SupportsTransparentBackColor, True)
  1761.         DoubleBuffered = True
  1762.         Size = New Size(78, 78)
  1763.         BackColor = Color.FromArgb(54, 54, 54)
  1764.     End Sub
  1765.  
  1766.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  1767.         Dim G = e.Graphics
  1768.         With G
  1769.             .TextRenderingHint = TextRenderingHint.AntiAliasGridFit
  1770.             .SmoothingMode = SmoothingMode.HighQuality
  1771.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  1772.             .Clear(BackColor)
  1773.             Select Case _Value
  1774.                 Case 0
  1775.                     .DrawArc(New Pen(New SolidBrush(_BorderColour), 1 + 5), CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 4, Height - 3 - 3, _StartingAngle - 3, _RotationAngle + 5)
  1776.                     .DrawArc(New Pen(New SolidBrush(_BaseColour), 1 + 3), CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 4, Height - 3 - 3, _StartingAngle, _RotationAngle)
  1777.                     .DrawString(CStr(_Value), _Font, Brushes.White, New Point(CInt(Width / 2), CInt(Height / 2 - 1)), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  1778.                 Case _Maximum
  1779.                     .DrawArc(New Pen(New SolidBrush(_BorderColour), 1 + 5), CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 4, Height - 3 - 3, _StartingAngle - 3, _RotationAngle + 5)
  1780.                     .DrawArc(New Pen(New SolidBrush(_BaseColour), 1 + 3), CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 4, Height - 3 - 3, _StartingAngle, _RotationAngle)
  1781.                     .DrawArc(New Pen(New SolidBrush(_ProgressColour), 1 + 3), CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 4, Height - 3 - 3, _StartingAngle, _RotationAngle)
  1782.                     .DrawString(CStr(_Value), _Font, Brushes.White, New Point(CInt(Width / 2), CInt(Height / 2 - 1)), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  1783.                 Case Else
  1784.                     .DrawArc(New Pen(New SolidBrush(_BorderColour), 1 + 5), CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 4, Height - 3 - 3, _StartingAngle - 3, _RotationAngle + 5)
  1785.                     .DrawArc(New Pen(New SolidBrush(_BaseColour), 1 + 3), CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 4, Height - 3 - 3, _StartingAngle, _RotationAngle)
  1786.                     .DrawArc(New Pen(New SolidBrush(_ProgressColour), 1 + 3), CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 4, Height - 3 - 3, _StartingAngle, CInt((_RotationAngle / _Maximum) * _Value))
  1787.                     .DrawString(CStr(_Value), _Font, Brushes.White, New Point(CInt(Width / 2), CInt(Height / 2 - 1)), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  1788.             End Select
  1789.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  1790.         End With
  1791.     End Sub
  1792. #End Region
  1793.  
  1794. End Class
  1795.  
  1796. <DefaultEvent("CheckedChanged")>
  1797. Public Class LogInRadioButton
  1798.     Inherits Control
  1799.  
  1800. #Region "Declarations"
  1801.     Private _Checked As Boolean
  1802.     Private State As MouseState = MouseState.None
  1803.     Private _HoverColour As Color = Color.FromArgb(50, 49, 51)
  1804.     Private _CheckedColour As Color = Color.FromArgb(173, 173, 174)
  1805.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  1806.     Private _BackColour As Color = Color.FromArgb(54, 54, 54)
  1807.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  1808. #End Region
  1809.  
  1810. #Region "Colour & Other Properties"
  1811.  
  1812.     <Category("Colours")>
  1813.     Public Property HighlightColour As Color
  1814.         Get
  1815.             Return _HoverColour
  1816.         End Get
  1817.         Set(value As Color)
  1818.             _HoverColour = value
  1819.         End Set
  1820.     End Property
  1821.  
  1822.     <Category("Colours")>
  1823.     Public Property BaseColour As Color
  1824.         Get
  1825.             Return _BackColour
  1826.         End Get
  1827.         Set(value As Color)
  1828.             _BackColour = value
  1829.         End Set
  1830.     End Property
  1831.  
  1832.     <Category("Colours")>
  1833.     Public Property BorderColour As Color
  1834.         Get
  1835.             Return _BorderColour
  1836.         End Get
  1837.         Set(value As Color)
  1838.             _BorderColour = value
  1839.         End Set
  1840.     End Property
  1841.  
  1842.     <Category("Colours")>
  1843.     Public Property CheckedColour As Color
  1844.         Get
  1845.             Return _CheckedColour
  1846.         End Get
  1847.         Set(value As Color)
  1848.             _CheckedColour = value
  1849.         End Set
  1850.     End Property
  1851.  
  1852.     <Category("Colours")>
  1853.     Public Property FontColour As Color
  1854.         Get
  1855.             Return _TextColour
  1856.         End Get
  1857.         Set(value As Color)
  1858.             _TextColour = value
  1859.         End Set
  1860.     End Property
  1861.  
  1862.     Event CheckedChanged(ByVal sender As Object)
  1863.     Property Checked() As Boolean
  1864.         Get
  1865.             Return _Checked
  1866.         End Get
  1867.         Set(value As Boolean)
  1868.             _Checked = value
  1869.             InvalidateControls()
  1870.             RaiseEvent CheckedChanged(Me)
  1871.             Invalidate()
  1872.         End Set
  1873.     End Property
  1874.  
  1875.     Protected Overrides Sub OnClick(e As EventArgs)
  1876.         If Not _Checked Then Checked = True
  1877.         MyBase.OnClick(e)
  1878.     End Sub
  1879.     Private Sub InvalidateControls()
  1880.         If Not IsHandleCreated OrElse Not _Checked Then Return
  1881.         For Each C As Control In Parent.Controls
  1882.             If C IsNot Me AndAlso TypeOf C Is LogInRadioButton Then
  1883.                 DirectCast(C, LogInRadioButton).Checked = False
  1884.                 Invalidate()
  1885.             End If
  1886.         Next
  1887.     End Sub
  1888.     Protected Overrides Sub OnCreateControl()
  1889.         MyBase.OnCreateControl()
  1890.         InvalidateControls()
  1891.     End Sub
  1892.     Protected Overrides Sub OnResize(e As EventArgs)
  1893.         MyBase.OnResize(e)
  1894.         Height = 22
  1895.     End Sub
  1896. #End Region
  1897.  
  1898. #Region "Mouse States"
  1899.  
  1900.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  1901.         MyBase.OnMouseDown(e)
  1902.         State = MouseState.Down : Invalidate()
  1903.     End Sub
  1904.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  1905.         MyBase.OnMouseUp(e)
  1906.         State = MouseState.Over : Invalidate()
  1907.     End Sub
  1908.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  1909.         MyBase.OnMouseEnter(e)
  1910.         State = MouseState.Over : Invalidate()
  1911.     End Sub
  1912.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  1913.         MyBase.OnMouseLeave(e)
  1914.         State = MouseState.None : Invalidate()
  1915.     End Sub
  1916.  
  1917. #End Region
  1918.  
  1919. #Region "Draw Control"
  1920.     Sub New()
  1921.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  1922.                    ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.SupportsTransparentBackColor, True)
  1923.         DoubleBuffered = True
  1924.         Cursor = Cursors.Hand
  1925.         Size = New Size(100, 22)
  1926.     End Sub
  1927.  
  1928.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  1929.         Dim G = e.Graphics
  1930.         Dim Base As New Rectangle(1, 1, Height - 2, Height - 2)
  1931.         Dim Circle As New Rectangle(6, 6, Height - 12, Height - 12)
  1932.         With G
  1933.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  1934.             .SmoothingMode = SmoothingMode.HighQuality
  1935.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  1936.             .Clear(_BackColour)
  1937.             .FillEllipse(New SolidBrush(_BackColour), Base)
  1938.             .DrawEllipse(New Pen(_BorderColour, 2), Base)
  1939.             If Checked Then
  1940.                 Select Case State
  1941.                     Case MouseState.Over
  1942.                         .FillEllipse(New SolidBrush(_HoverColour), New Rectangle(2, 2, Height - 4, Height - 4))
  1943.                 End Select
  1944.                 .FillEllipse(New SolidBrush(_CheckedColour), Circle)
  1945.             Else
  1946.                 Select Case State
  1947.                     Case MouseState.Over
  1948.                         .FillEllipse(New SolidBrush(_HoverColour), New Rectangle(2, 2, Height - 4, Height - 4))
  1949.                 End Select
  1950.             End If
  1951.             .DrawString(Text, Font, New SolidBrush(_TextColour), New Rectangle(24, 3, Width, Height), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Near})
  1952.             .InterpolationMode = CType(7, InterpolationMode)
  1953.         End With
  1954.     End Sub
  1955. #End Region
  1956.  
  1957. End Class
  1958.  
  1959. Public Class LogInLabel
  1960.     Inherits Label
  1961.  
  1962. #Region "Declaration"
  1963.     Private _FontColour As Color = Color.FromArgb(255, 255, 255)
  1964. #End Region
  1965.  
  1966. #Region "Property & Event"
  1967.  
  1968.     <Category("Colours")>
  1969.     Public Property FontColour As Color
  1970.         Get
  1971.             Return _FontColour
  1972.         End Get
  1973.         Set(value As Color)
  1974.             _FontColour = value
  1975.         End Set
  1976.     End Property
  1977.  
  1978.     Protected Overrides Sub OnTextChanged(e As EventArgs)
  1979.         MyBase.OnTextChanged(e) : Invalidate()
  1980.     End Sub
  1981.  
  1982. #End Region
  1983.  
  1984. #Region "Draw Control"
  1985.  
  1986.     Sub New()
  1987.         SetStyle(ControlStyles.SupportsTransparentBackColor, True)
  1988.         Font = New Font("Segoe UI", 9)
  1989.         ForeColor = _FontColour
  1990.         BackColor = Color.Transparent
  1991.         Text = Text
  1992.     End Sub
  1993.  
  1994. #End Region
  1995.  
  1996. End Class
  1997.  
  1998. Public Class LogInButton
  1999.     Inherits Control
  2000.  
  2001. #Region "Declarations"
  2002.     Private ReadOnly _Font As New Font("Segoe UI", 9)
  2003.     Private _ProgressColour As Color = Color.FromArgb(0, 191, 255)
  2004.     Private _BorderColour As Color = Color.FromArgb(25, 25, 25)
  2005.     Private _FontColour As Color = Color.FromArgb(255, 255, 255)
  2006.     Private _MainColour As Color = Color.FromArgb(42, 42, 42)
  2007.     Private _HoverColour As Color = Color.FromArgb(52, 52, 52)
  2008.     Private _PressedColour As Color = Color.FromArgb(47, 47, 47)
  2009.     Private State As New MouseState
  2010. #End Region
  2011.  
  2012. #Region "Mouse States"
  2013.  
  2014.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  2015.         MyBase.OnMouseDown(e)
  2016.         State = MouseState.Down : Invalidate()
  2017.     End Sub
  2018.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  2019.         MyBase.OnMouseUp(e)
  2020.         State = MouseState.Over : Invalidate()
  2021.     End Sub
  2022.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  2023.         MyBase.OnMouseEnter(e)
  2024.         State = MouseState.Over : Invalidate()
  2025.     End Sub
  2026.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  2027.         MyBase.OnMouseLeave(e)
  2028.         State = MouseState.None : Invalidate()
  2029.     End Sub
  2030.  
  2031. #End Region
  2032.  
  2033. #Region "Properties"
  2034.  
  2035.     <Category("Colours")>
  2036.     Public Property ProgressColour As Color
  2037.         Get
  2038.             Return _ProgressColour
  2039.         End Get
  2040.         Set(value As Color)
  2041.             _ProgressColour = value
  2042.         End Set
  2043.     End Property
  2044.  
  2045.     <Category("Colours")>
  2046.     Public Property BorderColour As Color
  2047.         Get
  2048.             Return _BorderColour
  2049.         End Get
  2050.         Set(value As Color)
  2051.             _BorderColour = value
  2052.         End Set
  2053.     End Property
  2054.  
  2055.     <Category("Colours")>
  2056.     Public Property FontColour As Color
  2057.         Get
  2058.             Return _FontColour
  2059.         End Get
  2060.         Set(value As Color)
  2061.             _FontColour = value
  2062.         End Set
  2063.     End Property
  2064.  
  2065.     <Category("Colours")>
  2066.     Public Property BaseColour As Color
  2067.         Get
  2068.             Return _MainColour
  2069.         End Get
  2070.         Set(value As Color)
  2071.             _MainColour = value
  2072.         End Set
  2073.     End Property
  2074.  
  2075.     <Category("Colours")>
  2076.     Public Property HoverColour As Color
  2077.         Get
  2078.             Return _HoverColour
  2079.         End Get
  2080.         Set(value As Color)
  2081.             _HoverColour = value
  2082.         End Set
  2083.     End Property
  2084.  
  2085.     <Category("Colours")>
  2086.     Public Property PressedColour As Color
  2087.         Get
  2088.             Return _PressedColour
  2089.         End Get
  2090.         Set(value As Color)
  2091.             _PressedColour = value
  2092.         End Set
  2093.     End Property
  2094.  
  2095. #End Region
  2096.  
  2097. #Region "Draw Control"
  2098.     Sub New()
  2099.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  2100.               ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  2101.               ControlStyles.SupportsTransparentBackColor, True)
  2102.         DoubleBuffered = True
  2103.         Size = New Size(75, 30)
  2104.         BackColor = Color.Transparent
  2105.     End Sub
  2106.  
  2107.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  2108.         Dim G = e.Graphics
  2109.         With G
  2110.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  2111.             .SmoothingMode = SmoothingMode.HighQuality
  2112.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  2113.             .InterpolationMode = CType(7, InterpolationMode)
  2114.             .Clear(BackColor)
  2115.             Select Case State
  2116.                 Case MouseState.None
  2117.                     .FillRectangle(New SolidBrush(_MainColour), New Rectangle(0, 0, Width, Height))
  2118.                     .DrawRectangle(New Pen(_BorderColour, 2), New Rectangle(0, 0, Width, Height))
  2119.                     .DrawString(Text, _Font, Brushes.White, New Point(CInt(Width / 2), CInt(Height / 2)), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  2120.                 Case MouseState.Over
  2121.                     .FillRectangle(New SolidBrush(_HoverColour), New Rectangle(0, 0, Width, Height))
  2122.                     .DrawRectangle(New Pen(_BorderColour, 1), New Rectangle(1, 1, Width - 2, Height - 2))
  2123.                     .DrawString(Text, _Font, Brushes.White, New Point(CInt(Width / 2), CInt(Height / 2)), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  2124.                 Case MouseState.Down
  2125.                     .FillRectangle(New SolidBrush(_PressedColour), New Rectangle(0, 0, Width, Height))
  2126.                     .DrawRectangle(New Pen(_BorderColour, 1), New Rectangle(1, 1, Width - 2, Height - 2))
  2127.                     .DrawString(Text, _Font, Brushes.White, New Point(CInt(Width / 2), CInt(Height / 2)), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  2128.             End Select
  2129.         End With
  2130.     End Sub
  2131.  
  2132. #End Region
  2133.  
  2134. End Class
  2135.  
  2136. Public Class LogInButtonWithProgress
  2137.     Inherits Control
  2138.  
  2139. #Region "Declarations"
  2140.     Private _Value As Integer = 0
  2141.     Private _Maximum As Integer = 100
  2142.     Private _Font As New Font("Segoe UI", 9)
  2143.     Private _ProgressColour As Color = Color.FromArgb(0, 191, 255)
  2144.     Private _BorderColour As Color = Color.FromArgb(25, 25, 25)
  2145.     Private _FontColour As Color = Color.FromArgb(255, 255, 255)
  2146.     Private _MainColour As Color = Color.FromArgb(42, 42, 42)
  2147.     Private _HoverColour As Color = Color.FromArgb(52, 52, 52)
  2148.     Private _PressedColour As Color = Color.FromArgb(47, 47, 47)
  2149.     Private State As New MouseState
  2150. #End Region
  2151.  
  2152. #Region "Mouse States"
  2153.  
  2154.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  2155.         MyBase.OnMouseDown(e)
  2156.         State = MouseState.Down : Invalidate()
  2157.     End Sub
  2158.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  2159.         MyBase.OnMouseUp(e)
  2160.         State = MouseState.Over : Invalidate()
  2161.     End Sub
  2162.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  2163.         MyBase.OnMouseEnter(e)
  2164.         State = MouseState.Over : Invalidate()
  2165.     End Sub
  2166.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  2167.         MyBase.OnMouseLeave(e)
  2168.         State = MouseState.None : Invalidate()
  2169.     End Sub
  2170.  
  2171. #End Region
  2172.  
  2173. #Region "Properties"
  2174.  
  2175.     <Category("Colours")>
  2176.     Public Property ProgressColour As Color
  2177.         Get
  2178.             Return _ProgressColour
  2179.         End Get
  2180.         Set(value As Color)
  2181.             _ProgressColour = value
  2182.         End Set
  2183.     End Property
  2184.  
  2185.     <Category("Colours")>
  2186.     Public Property BorderColour As Color
  2187.         Get
  2188.             Return _BorderColour
  2189.         End Get
  2190.         Set(value As Color)
  2191.             _BorderColour = value
  2192.         End Set
  2193.     End Property
  2194.  
  2195.     <Category("Colours")>
  2196.     Public Property FontColour As Color
  2197.         Get
  2198.             Return _FontColour
  2199.         End Get
  2200.         Set(value As Color)
  2201.             _FontColour = value
  2202.         End Set
  2203.     End Property
  2204.  
  2205.     <Category("Colours")>
  2206.     Public Property BaseColour As Color
  2207.         Get
  2208.             Return _MainColour
  2209.         End Get
  2210.         Set(value As Color)
  2211.             _MainColour = value
  2212.         End Set
  2213.     End Property
  2214.  
  2215.     <Category("Colours")>
  2216.     Public Property HoverColour As Color
  2217.         Get
  2218.             Return _HoverColour
  2219.         End Get
  2220.         Set(value As Color)
  2221.             _HoverColour = value
  2222.         End Set
  2223.     End Property
  2224.  
  2225.     <Category("Colours")>
  2226.     Public Property PressedColour As Color
  2227.         Get
  2228.             Return _PressedColour
  2229.         End Get
  2230.         Set(value As Color)
  2231.             _PressedColour = value
  2232.         End Set
  2233.     End Property
  2234.  
  2235.     <Category("Control")>
  2236.     Public Property Maximum() As Integer
  2237.         Get
  2238.             Return _Maximum
  2239.         End Get
  2240.         Set(V As Integer)
  2241.             Select Case V
  2242.                 Case Is < _Value
  2243.                     _Value = V
  2244.             End Select
  2245.             _Maximum = V
  2246.             Invalidate()
  2247.         End Set
  2248.     End Property
  2249.  
  2250.     <Category("Control")>
  2251.     Public Property Value() As Integer
  2252.         Get
  2253.             Select Case _Value
  2254.                 Case 0
  2255.                     Return 0
  2256.  
  2257.                 Case Else
  2258.                     Return _Value
  2259.  
  2260.             End Select
  2261.         End Get
  2262.         Set(V As Integer)
  2263.             Select Case V
  2264.                 Case Is > _Maximum
  2265.                     V = _Maximum
  2266.                     Invalidate()
  2267.             End Select
  2268.             _Value = V
  2269.             Invalidate()
  2270.         End Set
  2271.     End Property
  2272.  
  2273.     Public Sub Increment(ByVal Amount As Integer)
  2274.         Value += Amount
  2275.     End Sub
  2276.  
  2277. #End Region
  2278.  
  2279. #Region "Draw Control"
  2280.     Sub New()
  2281.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  2282.               ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  2283.               ControlStyles.SupportsTransparentBackColor, True)
  2284.         DoubleBuffered = True
  2285.         Size = New Size(75, 30)
  2286.         BackColor = Color.Transparent
  2287.     End Sub
  2288.  
  2289.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  2290.         Dim g = e.Graphics
  2291.         With G
  2292.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  2293.             .SmoothingMode = SmoothingMode.HighQuality
  2294.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  2295.             .Clear(BackColor)
  2296.             Select Case State
  2297.                 Case MouseState.None
  2298.                     .FillRectangle(New SolidBrush(_MainColour), New Rectangle(0, 0, Width, Height - 4))
  2299.                     .DrawRectangle(New Pen(_BorderColour, 2), New Rectangle(0, 0, Width, Height - 4))
  2300.                     .DrawString(Text, _Font, Brushes.White, New Point(CInt(Width / 2), CInt(Height / 2 - 2)), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  2301.                 Case MouseState.Over
  2302.                     .FillRectangle(New SolidBrush(_HoverColour), New Rectangle(0, 0, Width, Height - 4))
  2303.                     .DrawRectangle(New Pen(_BorderColour, 1), New Rectangle(1, 1, Width - 2, Height - 5))
  2304.                     .DrawString(Text, _Font, Brushes.White, New Point(CInt(Width / 2), CInt(Height / 2 - 2)), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  2305.                 Case MouseState.Down
  2306.                     .FillRectangle(New SolidBrush(_PressedColour), New Rectangle(0, 0, Width, Height - 4))
  2307.                     .DrawRectangle(New Pen(_BorderColour, 1), New Rectangle(1, 1, Width - 2, Height - 5))
  2308.                     .DrawString(Text, _Font, Brushes.White, New Point(CInt(Width / 2), CInt(Height / 2 - 2)), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  2309.             End Select
  2310.             Select Case _Value
  2311.                 Case 0
  2312.                 Case _Maximum
  2313.                     .FillRectangle(New SolidBrush(_ProgressColour), New Rectangle(0, Height - 4, Width, Height - 4))
  2314.                     .DrawRectangle(New Pen(_BorderColour, 2), New Rectangle(0, 0, Width, Height))
  2315.                 Case Else
  2316.                     .FillRectangle(New SolidBrush(_ProgressColour), New Rectangle(0, Height - 4, CInt(Width / _Maximum * _Value), Height - 4))
  2317.                     .DrawRectangle(New Pen(_BorderColour, 2), New Rectangle(0, 0, Width, Height))
  2318.             End Select
  2319.             .InterpolationMode = CType(7, InterpolationMode)
  2320.         End With
  2321.     End Sub
  2322.  
  2323. #End Region
  2324.  
  2325. End Class
  2326.  
  2327. Public Class LogInGroupBox
  2328.     Inherits ContainerControl
  2329.  
  2330. #Region "Declarations"
  2331.     Private _MainColour As Color = Color.FromArgb(47, 47, 47)
  2332.     Private _HeaderColour As Color = Color.FromArgb(42, 42, 42)
  2333.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  2334.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  2335. #End Region
  2336.  
  2337. #Region "Properties"
  2338.  
  2339.     <Category("Colours")>
  2340.     Public Property BorderColour As Color
  2341.         Get
  2342.             Return _BorderColour
  2343.         End Get
  2344.         Set(value As Color)
  2345.             _BorderColour = value
  2346.         End Set
  2347.     End Property
  2348.  
  2349.     <Category("Colours")>
  2350.     Public Property TextColour As Color
  2351.         Get
  2352.             Return _TextColour
  2353.         End Get
  2354.         Set(value As Color)
  2355.             _TextColour = value
  2356.         End Set
  2357.     End Property
  2358.  
  2359.     <Category("Colours")>
  2360.     Public Property HeaderColour As Color
  2361.         Get
  2362.             Return _HeaderColour
  2363.         End Get
  2364.         Set(value As Color)
  2365.             _HeaderColour = value
  2366.         End Set
  2367.     End Property
  2368.  
  2369.     <Category("Colours")>
  2370.     Public Property MainColour As Color
  2371.         Get
  2372.             Return _MainColour
  2373.         End Get
  2374.         Set(value As Color)
  2375.             _MainColour = value
  2376.         End Set
  2377.     End Property
  2378.  
  2379. #End Region
  2380.  
  2381. #Region "Draw Control"
  2382.     Sub New()
  2383.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  2384.                ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  2385.                ControlStyles.SupportsTransparentBackColor, True)
  2386.         DoubleBuffered = True
  2387.         Size = New Size(160, 110)
  2388.         Font = New Font("Segoe UI", 10, FontStyle.Bold)
  2389.     End Sub
  2390.  
  2391.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  2392.         Dim g = e.Graphics
  2393.         With G
  2394.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  2395.             .SmoothingMode = SmoothingMode.HighQuality
  2396.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  2397.             .Clear(Color.FromArgb(54, 54, 54))
  2398.             .FillRectangle(New SolidBrush(_MainColour), New Rectangle(0, 28, Width, Height))
  2399.             .FillRectangle(New SolidBrush(_HeaderColour), New Rectangle(0, 0, CInt(.MeasureString(Text, Font).Width + 7), 28))
  2400.             .DrawString(Text, Font, New SolidBrush(_TextColour), New Point(5, 5))
  2401.             Dim P() As Point = {New Point(0, 0), New Point(CInt(.MeasureString(Text, Font).Width + 7), 0), New Point(CInt(.MeasureString(Text, Font).Width + 7), 28), _
  2402.                                 New Point(Width - 1, 28), New Point(Width - 1, Height - 1), New Point(1, Height - 1), New Point(1, 1)}
  2403.             .DrawLines(New Pen(_BorderColour), P)
  2404.             .DrawLine(New Pen(_BorderColour, 2), New Point(0, 28), New Point(CInt(.MeasureString(Text, Font).Width + 7), 28))
  2405.             .InterpolationMode = CType(7, InterpolationMode)
  2406.         End With
  2407.     End Sub
  2408. #End Region
  2409.  
  2410. End Class
  2411.  
  2412. Public Class LogInSeperator
  2413.     Inherits Control
  2414.  
  2415. #Region "Declarations"
  2416.     Private _SeperatorColour As Color = Color.FromArgb(35, 35, 35)
  2417.     Private _Alignment As Style = Style.Horizontal
  2418.     Private _Thickness As Single = 1
  2419. #End Region
  2420.  
  2421. #Region "Properties"
  2422.  
  2423.     Enum Style
  2424.         Horizontal
  2425.         Verticle
  2426.     End Enum
  2427.  
  2428.     <Category("Control")>
  2429.     Public Property Thickness As Single
  2430.         Get
  2431.             Return _Thickness
  2432.         End Get
  2433.         Set(value As Single)
  2434.             _Thickness = value
  2435.         End Set
  2436.     End Property
  2437.  
  2438.     <Category("Control")>
  2439.     Public Property Alignment As Style
  2440.         Get
  2441.             Return _Alignment
  2442.         End Get
  2443.         Set(value As Style)
  2444.             _Alignment = value
  2445.         End Set
  2446.     End Property
  2447.  
  2448.     <Category("Colours")>
  2449.     Public Property SeperatorColour As Color
  2450.         Get
  2451.             Return _SeperatorColour
  2452.         End Get
  2453.         Set(value As Color)
  2454.             _SeperatorColour = value
  2455.         End Set
  2456.     End Property
  2457.  
  2458. #End Region
  2459.  
  2460. #Region "Draw Control"
  2461.     Sub New()
  2462.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  2463.                  ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  2464.                  ControlStyles.SupportsTransparentBackColor, True)
  2465.         DoubleBuffered = True
  2466.         BackColor = Color.Transparent
  2467.         Size = New Size(20, 20)
  2468.     End Sub
  2469.  
  2470.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  2471.         Dim G = e.Graphics
  2472.         Dim Base As New Rectangle(0, 0, Width - 1, Height - 1)
  2473.         With G
  2474.             .SmoothingMode = SmoothingMode.HighQuality
  2475.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  2476.             Select Case _Alignment
  2477.                 Case Style.Horizontal
  2478.                     .DrawLine(New Pen(_SeperatorColour, _Thickness), New Point(0, CInt(Height / 2)), New Point(Width, CInt(Height / 2)))
  2479.                 Case Style.Verticle
  2480.                     .DrawLine(New Pen(_SeperatorColour, _Thickness), New Point(CInt(Width / 2), 0), New Point(CInt(Width / 2), Height))
  2481.             End Select
  2482.             .InterpolationMode = CType(7, InterpolationMode)
  2483.         End With
  2484.     End Sub
  2485. #End Region
  2486.  
  2487. End Class
  2488.  
  2489. Public Class LogInNumeric
  2490.     Inherits Control
  2491.  
  2492. #Region "Variables"
  2493.  
  2494.     Private State As MouseState = MouseState.None
  2495.     Private MouseXLoc, MouseYLoc As Integer
  2496.     Private _Value As Long
  2497.     Private _Minimum As Long = 0
  2498.     Private _Maximum As Long = 9999999
  2499.     Private BoolValue As Boolean
  2500.     Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
  2501.     Private _ButtonColour As Color = Color.FromArgb(47, 47, 47)
  2502.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  2503.     Private _SecondBorderColour As Color = Color.FromArgb(0, 191, 255)
  2504.     Private _FontColour As Color = Color.FromArgb(255, 255, 255)
  2505.  
  2506. #End Region
  2507.  
  2508. #Region "Properties & Events"
  2509.  
  2510.     Public Property Value As Long
  2511.         Get
  2512.             Return _Value
  2513.         End Get
  2514.         Set(value As Long)
  2515.             If value <= _Maximum And value >= _Minimum Then _Value = value
  2516.             Invalidate()
  2517.         End Set
  2518.     End Property
  2519.  
  2520.     Public Property Maximum As Long
  2521.         Get
  2522.             Return _Maximum
  2523.         End Get
  2524.         Set(value As Long)
  2525.             If value > _Minimum Then _Maximum = value
  2526.             If _Value > _Maximum Then _Value = _Maximum
  2527.             Invalidate()
  2528.         End Set
  2529.     End Property
  2530.  
  2531.     Public Property Minimum As Long
  2532.         Get
  2533.             Return _Minimum
  2534.         End Get
  2535.         Set(value As Long)
  2536.             If value < _Maximum Then _Minimum = value
  2537.             If _Value < _Minimum Then _Value = Minimum
  2538.             Invalidate()
  2539.         End Set
  2540.     End Property
  2541.  
  2542.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  2543.         MyBase.OnMouseMove(e)
  2544.         MouseXLoc = e.Location.X
  2545.         MouseYLoc = e.Location.Y
  2546.         Invalidate()
  2547.         If e.X < Width - 47 Then Cursor = Cursors.IBeam Else Cursor = Cursors.Hand
  2548.     End Sub
  2549.  
  2550.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  2551.         MyBase.OnMouseDown(e)
  2552.         If MouseXLoc > Width - 47 AndAlso MouseXLoc < Width - 3 Then
  2553.             If MouseXLoc < Width - 23 Then
  2554.                 If (Value + 1) <= _Maximum Then _Value += 1
  2555.             Else
  2556.                 If (Value - 1) >= _Minimum Then _Value -= 1
  2557.             End If
  2558.         Else
  2559.             BoolValue = Not BoolValue
  2560.             Focus()
  2561.         End If
  2562.         Invalidate()
  2563.     End Sub
  2564.  
  2565.     Protected Overrides Sub OnKeyPress(e As KeyPressEventArgs)
  2566.         MyBase.OnKeyPress(e)
  2567.         Try
  2568.             If BoolValue Then _Value = CLng(CStr(CStr(_Value) & e.KeyChar.ToString()))
  2569.             If _Value > _Maximum Then _Value = _Maximum
  2570.             Invalidate()
  2571.         Catch : End Try
  2572.     End Sub
  2573.  
  2574.     Protected Overrides Sub OnKeyDown(e As KeyEventArgs)
  2575.         MyBase.OnKeyDown(e)
  2576.         If e.KeyCode = Keys.Back Then
  2577.             Value = 0
  2578.         End If
  2579.     End Sub
  2580.  
  2581.     Protected Overrides Sub OnResize(e As EventArgs)
  2582.         MyBase.OnResize(e)
  2583.         Height = 24
  2584.     End Sub
  2585.  
  2586.     <Category("Colours")> _
  2587.     Public Property BaseColour As Color
  2588.         Get
  2589.             Return _BaseColour
  2590.         End Get
  2591.         Set(value As Color)
  2592.             _BaseColour = value
  2593.         End Set
  2594.     End Property
  2595.  
  2596.     <Category("Colours")> _
  2597.     Public Property ButtonColour As Color
  2598.         Get
  2599.             Return _ButtonColour
  2600.         End Get
  2601.         Set(value As Color)
  2602.             _ButtonColour = value
  2603.         End Set
  2604.     End Property
  2605.  
  2606.     <Category("Colours")> _
  2607.     Public Property BorderColour As Color
  2608.         Get
  2609.             Return _BorderColour
  2610.         End Get
  2611.         Set(value As Color)
  2612.             _BorderColour = value
  2613.         End Set
  2614.     End Property
  2615.  
  2616.     <Category("Colours")> _
  2617.     Public Property SecondBorderColour As Color
  2618.         Get
  2619.             Return _SecondBorderColour
  2620.         End Get
  2621.         Set(value As Color)
  2622.             _SecondBorderColour = value
  2623.         End Set
  2624.     End Property
  2625.  
  2626.     <Category("Colours")> _
  2627.     Public Property FontColour As Color
  2628.         Get
  2629.             Return _FontColour
  2630.         End Get
  2631.         Set(value As Color)
  2632.             _FontColour = value
  2633.         End Set
  2634.     End Property
  2635.  
  2636. #End Region
  2637.  
  2638. #Region "Draw Control"
  2639.  
  2640.     Sub New()
  2641.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  2642.         ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  2643.         ControlStyles.SupportsTransparentBackColor, True)
  2644.         DoubleBuffered = True
  2645.         Font = New Font("Segoe UI", 10)
  2646.     End Sub
  2647.  
  2648.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  2649.         Dim g = e.Graphics
  2650.         Dim Base As New Rectangle(0, 0, Width, Height)
  2651.         Dim CenterSF As New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center}
  2652.         With G
  2653.             .SmoothingMode = SmoothingMode.HighQuality
  2654.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  2655.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  2656.             .Clear(BackColor)
  2657.             .FillRectangle(New SolidBrush(_BaseColour), Base)
  2658.             .FillRectangle(New SolidBrush(_ButtonColour), New Rectangle(Width - 48, 0, 48, Height))
  2659.             .DrawRectangle(New Pen(_BorderColour, 2), Base)
  2660.             .DrawLine(New Pen(_SecondBorderColour), New Point(Width - 48, 1), New Point(Width - 48, Height - 2))
  2661.             .DrawLine(New Pen(_BorderColour), New Point(Width - 24, 1), New Point(Width - 24, Height - 2))
  2662.             .DrawLine(New Pen(_FontColour), New Point(Width - 36, 7), New Point(Width - 36, 17))
  2663.             .DrawLine(New Pen(_FontColour), New Point(Width - 31, 12), New Point(Width - 41, 12))
  2664.             .DrawLine(New Pen(_FontColour), New Point(Width - 17, 13), New Point(Width - 7, 13))
  2665.             .DrawString(CStr(Value), Font, New SolidBrush(_FontColour), New Rectangle(5, 1, Width, Height), New StringFormat() With {.LineAlignment = StringAlignment.Center})
  2666.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  2667.         End With
  2668.     End Sub
  2669.  
  2670. #End Region
  2671.  
  2672. End Class
  2673.  
  2674. Public Class LogInColourTable
  2675.     Inherits ProfessionalColorTable
  2676.  
  2677. #Region "Declarations"
  2678.  
  2679.     Private _BackColour As Color = Color.FromArgb(42, 42, 42)
  2680.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  2681.     Private _SelectedColour As Color = Color.FromArgb(47, 47, 47)
  2682.  
  2683. #End Region
  2684.  
  2685. #Region "Properties"
  2686.  
  2687.     <Category("Colours")>
  2688.     Public Property SelectedColour As Color
  2689.         Get
  2690.             Return _SelectedColour
  2691.         End Get
  2692.         Set(value As Color)
  2693.             _SelectedColour = value
  2694.         End Set
  2695.     End Property
  2696.  
  2697.     <Category("Colours")>
  2698.     Public Property BorderColour As Color
  2699.         Get
  2700.             Return _BorderColour
  2701.         End Get
  2702.         Set(value As Color)
  2703.             _BorderColour = value
  2704.         End Set
  2705.     End Property
  2706.  
  2707.     <Category("Colours")>
  2708.     Public Property BackColour As Color
  2709.         Get
  2710.             Return _BackColour
  2711.         End Get
  2712.         Set(value As Color)
  2713.             _BackColour = value
  2714.         End Set
  2715.     End Property
  2716.  
  2717.     Public Overrides ReadOnly Property ButtonSelectedBorder() As Color
  2718.         Get
  2719.             Return _BackColour
  2720.         End Get
  2721.     End Property
  2722.  
  2723.     Public Overrides ReadOnly Property CheckBackground() As Color
  2724.         Get
  2725.             Return _BackColour
  2726.         End Get
  2727.     End Property
  2728.  
  2729.     Public Overrides ReadOnly Property CheckPressedBackground() As Color
  2730.         Get
  2731.             Return _BackColour
  2732.         End Get
  2733.     End Property
  2734.  
  2735.     Public Overrides ReadOnly Property CheckSelectedBackground() As Color
  2736.         Get
  2737.             Return _BackColour
  2738.         End Get
  2739.     End Property
  2740.  
  2741.     Public Overrides ReadOnly Property ImageMarginGradientBegin() As Color
  2742.         Get
  2743.             Return _BackColour
  2744.         End Get
  2745.     End Property
  2746.  
  2747.     Public Overrides ReadOnly Property ImageMarginGradientEnd() As Color
  2748.         Get
  2749.             Return _BackColour
  2750.         End Get
  2751.     End Property
  2752.  
  2753.     Public Overrides ReadOnly Property ImageMarginGradientMiddle() As Color
  2754.         Get
  2755.             Return _BackColour
  2756.         End Get
  2757.     End Property
  2758.  
  2759.     Public Overrides ReadOnly Property MenuBorder() As Color
  2760.         Get
  2761.             Return _BorderColour
  2762.         End Get
  2763.     End Property
  2764.  
  2765.     Public Overrides ReadOnly Property MenuItemBorder() As Color
  2766.         Get
  2767.             Return _BackColour
  2768.         End Get
  2769.     End Property
  2770.  
  2771.     Public Overrides ReadOnly Property MenuItemSelected() As Color
  2772.         Get
  2773.             Return _SelectedColour
  2774.         End Get
  2775.     End Property
  2776.  
  2777.     Public Overrides ReadOnly Property SeparatorDark() As Color
  2778.         Get
  2779.             Return _BorderColour
  2780.         End Get
  2781.     End Property
  2782.  
  2783.     Public Overrides ReadOnly Property ToolStripDropDownBackground() As Color
  2784.         Get
  2785.             Return _BackColour
  2786.         End Get
  2787.     End Property
  2788.  
  2789. #End Region
  2790.  
  2791. End Class
  2792.  
  2793. Public Class LogInListBox
  2794.     Inherits Control
  2795.  
  2796. #Region "Variables"
  2797.  
  2798.     Private WithEvents ListB As New ListBox
  2799.     Private _Items As String() = {""}
  2800.     Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
  2801.     Private _SelectedColour As Color = Color.FromArgb(55, 55, 55)
  2802.     Private _ListBaseColour As Color = Color.FromArgb(47, 47, 47)
  2803.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  2804.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  2805.  
  2806. #End Region
  2807.  
  2808. #Region "Properties"
  2809.  
  2810.     <Category("Control")> _
  2811.     Public Property Items As String()
  2812.         Get
  2813.             Return _Items
  2814.         End Get
  2815.         Set(value As String())
  2816.             _Items = value
  2817.             ListB.Items.Clear()
  2818.             ListB.Items.AddRange(value)
  2819.             Invalidate()
  2820.         End Set
  2821.     End Property
  2822.  
  2823.     <Category("Colours")> _
  2824.     Public Property BorderColour As Color
  2825.         Get
  2826.             Return _BorderColour
  2827.         End Get
  2828.         Set(value As Color)
  2829.             _BorderColour = value
  2830.         End Set
  2831.     End Property
  2832.  
  2833.     <Category("Colours")> _
  2834.     Public Property SelectedColour As Color
  2835.         Get
  2836.             Return _SelectedColour
  2837.         End Get
  2838.         Set(value As Color)
  2839.             _SelectedColour = value
  2840.         End Set
  2841.     End Property
  2842.  
  2843.     <Category("Colours")> _
  2844.     Public Property BaseColour As Color
  2845.         Get
  2846.             Return _BaseColour
  2847.         End Get
  2848.         Set(value As Color)
  2849.             _BaseColour = value
  2850.         End Set
  2851.     End Property
  2852.  
  2853.     <Category("Colours")> _
  2854.     Public Property ListBaseColour As Color
  2855.         Get
  2856.             Return _ListBaseColour
  2857.         End Get
  2858.         Set(value As Color)
  2859.             _ListBaseColour = value
  2860.         End Set
  2861.     End Property
  2862.  
  2863.     <Category("Colours")> _
  2864.     Public Property TextColour As Color
  2865.         Get
  2866.             Return _TextColour
  2867.         End Get
  2868.         Set(value As Color)
  2869.             _TextColour = value
  2870.         End Set
  2871.     End Property
  2872.  
  2873.     Public ReadOnly Property SelectedItem() As String
  2874.         Get
  2875.             Return CStr(ListB.SelectedItem)
  2876.         End Get
  2877.     End Property
  2878.  
  2879.     Public ReadOnly Property SelectedIndex() As Integer
  2880.         Get
  2881.             Return ListB.SelectedIndex
  2882.             If ListB.SelectedIndex < 0 Then Exit Property
  2883.         End Get
  2884.     End Property
  2885.  
  2886.     Public Sub Clear()
  2887.         ListB.Items.Clear()
  2888.     End Sub
  2889.  
  2890.     Public Sub ClearSelected()
  2891.         For i As Integer = (ListB.SelectedItems.Count - 1) To 0 Step -1
  2892.             ListB.Items.Remove(ListB.SelectedItems(i))
  2893.         Next
  2894.     End Sub
  2895.  
  2896.     Protected Overrides Sub OnCreateControl()
  2897.         MyBase.OnCreateControl()
  2898.         If Not Controls.Contains(ListB) Then
  2899.             Controls.Add(ListB)
  2900.         End If
  2901.     End Sub
  2902.  
  2903.     Sub AddRange(ByVal items As Object())
  2904.         ListB.Items.Remove("")
  2905.         ListB.Items.AddRange(items)
  2906.     End Sub
  2907.  
  2908.     Sub AddItem(ByVal item As Object)
  2909.         ListB.Items.Remove("")
  2910.         ListB.Items.Add(item)
  2911.     End Sub
  2912.  
  2913. #End Region
  2914.  
  2915. #Region "Draw Control"
  2916.  
  2917.     Sub Drawitem(ByVal sender As Object, ByVal e As DrawItemEventArgs) Handles ListB.DrawItem
  2918.         If e.Index < 0 Then Exit Sub
  2919.         e.DrawBackground()
  2920.         e.DrawFocusRectangle()
  2921.         With e.Graphics
  2922.             .SmoothingMode = SmoothingMode.HighQuality
  2923.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  2924.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  2925.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  2926.             If InStr(e.State.ToString, "Selected,") > 0 Then
  2927.                 .FillRectangle(New SolidBrush(_SelectedColour), New Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height - 1))
  2928.                 .DrawString(" " & ListB.Items(e.Index).ToString(), New Font("Segoe UI", 9, FontStyle.Bold), New SolidBrush(_TextColour), e.Bounds.X, e.Bounds.Y + 2)
  2929.             Else
  2930.                 .FillRectangle(New SolidBrush(_ListBaseColour), New Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height))
  2931.                 .DrawString(" " & ListB.Items(e.Index).ToString(), New Font("Segoe UI", 8), New SolidBrush(_TextColour), e.Bounds.X, e.Bounds.Y + 2)
  2932.             End If
  2933.             .Dispose()
  2934.         End With
  2935.     End Sub
  2936.  
  2937.     Sub New()
  2938.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  2939.             ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer, True)
  2940.         DoubleBuffered = True
  2941.         ListB.DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
  2942.         ListB.ScrollAlwaysVisible = False
  2943.         ListB.HorizontalScrollbar = False
  2944.         ListB.BorderStyle = BorderStyle.None
  2945.         ListB.BackColor = _BaseColour
  2946.         ListB.Location = New Point(3, 3)
  2947.         ListB.Font = New Font("Segoe UI", 8)
  2948.         ListB.ItemHeight = 20
  2949.         ListB.Items.Clear()
  2950.         ListB.IntegralHeight = False
  2951.         Size = New Size(130, 100)
  2952.     End Sub
  2953.  
  2954.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  2955.         Dim G = e.Graphics
  2956.         Dim Base As New Rectangle(0, 0, Width, Height)
  2957.         With G
  2958.             .SmoothingMode = SmoothingMode.HighQuality
  2959.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  2960.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  2961.             .Clear(BackColor)
  2962.             ListB.Size = New Size(Width - 6, Height - 5)
  2963.             .FillRectangle(New SolidBrush(_BaseColour), Base)
  2964.             .DrawRectangle(New Pen(_BorderColour, 3), New Rectangle(0, 0, Width, Height - 1))
  2965.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  2966.         End With
  2967.     End Sub
  2968.  
  2969. #End Region
  2970.  
  2971. End Class
  2972.  
  2973. Public Class LogInTitledListBox
  2974.     Inherits Control
  2975.  
  2976. #Region "Variables"
  2977.  
  2978.     Private WithEvents ListB As New ListBox
  2979.     Private _Items As String() = {""}
  2980.     Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
  2981.     Private _SelectedColour As Color = Color.FromArgb(55, 55, 55)
  2982.     Private _ListBaseColour As Color = Color.FromArgb(47, 47, 47)
  2983.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  2984.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  2985.     Private _TitleFont As New Font("Segeo UI", 10, FontStyle.Bold)
  2986.  
  2987. #End Region
  2988.  
  2989. #Region "Properties"
  2990.  
  2991.     <Category("Control")>
  2992.     Public Property TitleFont As Font
  2993.         Get
  2994.             Return _TitleFont
  2995.         End Get
  2996.         Set(value As Font)
  2997.             _TitleFont = value
  2998.         End Set
  2999.     End Property
  3000.  
  3001.     <Category("Control")> _
  3002.     Public Property Items As String()
  3003.         Get
  3004.             Return _Items
  3005.         End Get
  3006.         Set(value As String())
  3007.             _Items = value
  3008.             ListB.Items.Clear()
  3009.             ListB.Items.AddRange(value)
  3010.             Invalidate()
  3011.         End Set
  3012.     End Property
  3013.  
  3014.     <Category("Colours")> _
  3015.     Public Property BorderColour As Color
  3016.         Get
  3017.             Return _BorderColour
  3018.         End Get
  3019.         Set(value As Color)
  3020.             _BorderColour = value
  3021.         End Set
  3022.     End Property
  3023.  
  3024.     <Category("Colours")> _
  3025.     Public Property SelectedColour As Color
  3026.         Get
  3027.             Return _SelectedColour
  3028.         End Get
  3029.         Set(value As Color)
  3030.             _SelectedColour = value
  3031.         End Set
  3032.     End Property
  3033.  
  3034.     <Category("Colours")> _
  3035.     Public Property BaseColour As Color
  3036.         Get
  3037.             Return _BaseColour
  3038.         End Get
  3039.         Set(value As Color)
  3040.             _BaseColour = value
  3041.         End Set
  3042.     End Property
  3043.  
  3044.     <Category("Colours")> _
  3045.     Public Property ListBaseColour As Color
  3046.         Get
  3047.             Return _ListBaseColour
  3048.         End Get
  3049.         Set(value As Color)
  3050.             _ListBaseColour = value
  3051.         End Set
  3052.     End Property
  3053.  
  3054.     <Category("Colours")> _
  3055.     Public Property TextColour As Color
  3056.         Get
  3057.             Return _TextColour
  3058.         End Get
  3059.         Set(value As Color)
  3060.             _TextColour = value
  3061.         End Set
  3062.     End Property
  3063.  
  3064.     Public ReadOnly Property SelectedItem() As String
  3065.         Get
  3066.             Return CStr(ListB.SelectedItem)
  3067.         End Get
  3068.     End Property
  3069.  
  3070.     Public ReadOnly Property SelectedIndex() As Integer
  3071.         Get
  3072.             Return ListB.SelectedIndex
  3073.             If ListB.SelectedIndex < 0 Then Exit Property
  3074.         End Get
  3075.     End Property
  3076.  
  3077.     Public Sub Clear()
  3078.         ListB.Items.Clear()
  3079.     End Sub
  3080.  
  3081.     Public Sub ClearSelected()
  3082.         For i As Integer = (ListB.SelectedItems.Count - 1) To 0 Step -1
  3083.             ListB.Items.Remove(ListB.SelectedItems(i))
  3084.         Next
  3085.     End Sub
  3086.  
  3087.     Protected Overrides Sub OnCreateControl()
  3088.         MyBase.OnCreateControl()
  3089.         If Not Controls.Contains(ListB) Then
  3090.             Controls.Add(ListB)
  3091.         End If
  3092.     End Sub
  3093.  
  3094.     Sub AddRange(ByVal items As Object())
  3095.         ListB.Items.Remove("")
  3096.         ListB.Items.AddRange(items)
  3097.     End Sub
  3098.  
  3099.     Sub AddItem(ByVal item As Object)
  3100.         ListB.Items.Remove("")
  3101.         ListB.Items.Add(item)
  3102.     End Sub
  3103.  
  3104. #End Region
  3105.  
  3106. #Region "Draw Control"
  3107.  
  3108.     Sub Drawitem(ByVal sender As Object, ByVal e As DrawItemEventArgs) Handles ListB.DrawItem
  3109.         If e.Index < 0 Then Exit Sub
  3110.         e.DrawBackground()
  3111.         e.DrawFocusRectangle()
  3112.         With e.Graphics
  3113.             .SmoothingMode = SmoothingMode.HighQuality
  3114.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  3115.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  3116.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  3117.             If InStr(e.State.ToString, "Selected,") > 0 Then
  3118.                 .FillRectangle(New SolidBrush(_SelectedColour), New Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height - 1))
  3119.                 .DrawString(" " & ListB.Items(e.Index).ToString(), New Font("Segoe UI", 9, FontStyle.Bold), New SolidBrush(_TextColour), e.Bounds.X, e.Bounds.Y + 2)
  3120.             Else
  3121.                 .FillRectangle(New SolidBrush(_ListBaseColour), New Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height))
  3122.                 .DrawString(" " & ListB.Items(e.Index).ToString(), New Font("Segoe UI", 8), New SolidBrush(_TextColour), e.Bounds.X, e.Bounds.Y + 2)
  3123.             End If
  3124.             .Dispose()
  3125.         End With
  3126.     End Sub
  3127.  
  3128.     Sub New()
  3129.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  3130.             ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer, True)
  3131.         DoubleBuffered = True
  3132.         ListB.DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
  3133.         ListB.ScrollAlwaysVisible = False
  3134.         ListB.HorizontalScrollbar = False
  3135.         ListB.BorderStyle = BorderStyle.None
  3136.         ListB.BackColor = BaseColour
  3137.         ListB.Location = New Point(3, 28)
  3138.         ListB.Font = New Font("Segoe UI", 8)
  3139.         ListB.ItemHeight = 20
  3140.         ListB.Items.Clear()
  3141.         ListB.IntegralHeight = False
  3142.         Size = New Size(130, 100)
  3143.     End Sub
  3144.  
  3145.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  3146.  
  3147.         Dim G = e.Graphics
  3148.         Dim Base As New Rectangle(0, 0, Width, Height)
  3149.         With G
  3150.             .SmoothingMode = SmoothingMode.HighQuality
  3151.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  3152.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  3153.             .Clear(BackColor)
  3154.             ListB.Size = New Size(Width - 6, Height - 30)
  3155.             .FillRectangle(New SolidBrush(BaseColour), Base)
  3156.             .DrawRectangle(New Pen((_BorderColour), 3), New Rectangle(0, 0, Width, Height - 1))
  3157.             .DrawLine(New Pen((_BorderColour), 2), New Point(0, 27), New Point(Width - 1, 27))
  3158.             .DrawString(Text, _TitleFont, New SolidBrush(_TextColour), New Rectangle(2, 5, Width - 5, 20), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  3159.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  3160.         End With
  3161.     End Sub
  3162.  
  3163. #End Region
  3164.  
  3165. End Class
  3166.  
  3167. Public Class LogInContextMenu
  3168.     Inherits ContextMenuStrip
  3169.  
  3170. #Region "Declarations"
  3171.  
  3172.     Private _FontColour As Color = Color.FromArgb(55, 255, 255)
  3173.  
  3174. #End Region
  3175.  
  3176. #Region "Properties"
  3177.  
  3178.     Public Property FontColour As Color
  3179.         Get
  3180.             Return _FontColour
  3181.         End Get
  3182.         Set(value As Color)
  3183.             _FontColour = value
  3184.         End Set
  3185.     End Property
  3186.  
  3187. #End Region
  3188.  
  3189. #Region "Draw Control"
  3190.  
  3191.     Sub New()
  3192.         Renderer = New ToolStripProfessionalRenderer(New LogInColourTable())
  3193.         ShowCheckMargin = False
  3194.         ShowImageMargin = False
  3195.         ForeColor = Color.FromArgb(255, 255, 255)
  3196.     End Sub
  3197.  
  3198.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  3199.         e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  3200.         MyBase.OnPaint(e)
  3201.     End Sub
  3202.  
  3203. #End Region
  3204.  
  3205. End Class
  3206.  
  3207. Public Class LogInProgressBar
  3208.     Inherits Control
  3209.  
  3210. #Region "Declarations"
  3211.     Private _ProgressColour As Color = Color.FromArgb(0, 160, 199)
  3212.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  3213.     Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
  3214.     Private _FontColour As Color = Color.FromArgb(50, 50, 50)
  3215.     Private _SecondColour As Color = Color.FromArgb(0, 145, 184)
  3216.     Private _Value As Integer = 0
  3217.     Private _Maximum As Integer = 100
  3218.     Private _TwoColour As Boolean = True
  3219. #End Region
  3220.  
  3221. #Region "Properties"
  3222.  
  3223.     Public Property SecondColour As Color
  3224.         Get
  3225.             Return _SecondColour
  3226.         End Get
  3227.         Set(value As Color)
  3228.             _SecondColour = value
  3229.         End Set
  3230.     End Property
  3231.  
  3232.     <Category("Control")>
  3233.     Public Property TwoColour As Boolean
  3234.         Get
  3235.             Return _TwoColour
  3236.         End Get
  3237.         Set(value As Boolean)
  3238.             _TwoColour = value
  3239.         End Set
  3240.     End Property
  3241.  
  3242.     <Category("Control")>
  3243.     Public Property Maximum() As Integer
  3244.         Get
  3245.             Return _Maximum
  3246.         End Get
  3247.         Set(V As Integer)
  3248.             Select Case V
  3249.                 Case Is < _Value
  3250.                     _Value = V
  3251.             End Select
  3252.             _Maximum = V
  3253.             Invalidate()
  3254.         End Set
  3255.     End Property
  3256.  
  3257.     <Category("Control")>
  3258.     Public Property Value() As Integer
  3259.         Get
  3260.             Select Case _Value
  3261.                 Case 0
  3262.                     Return 0
  3263.                     Invalidate()
  3264.                 Case Else
  3265.                     Return _Value
  3266.                     Invalidate()
  3267.             End Select
  3268.         End Get
  3269.         Set(V As Integer)
  3270.             Select Case V
  3271.                 Case Is > _Maximum
  3272.                     V = _Maximum
  3273.                     Invalidate()
  3274.             End Select
  3275.             _Value = V
  3276.             Invalidate()
  3277.         End Set
  3278.     End Property
  3279.  
  3280.     <Category("Colours")>
  3281.     Public Property ProgressColour As Color
  3282.         Get
  3283.             Return _ProgressColour
  3284.         End Get
  3285.         Set(value As Color)
  3286.             _ProgressColour = value
  3287.         End Set
  3288.     End Property
  3289.  
  3290.     <Category("Colours")>
  3291.     Public Property BaseColour As Color
  3292.         Get
  3293.             Return _BaseColour
  3294.         End Get
  3295.         Set(value As Color)
  3296.             _BaseColour = value
  3297.         End Set
  3298.     End Property
  3299.  
  3300.     <Category("Colours")>
  3301.     Public Property BorderColour As Color
  3302.         Get
  3303.             Return _BorderColour
  3304.         End Get
  3305.         Set(value As Color)
  3306.             _BorderColour = value
  3307.         End Set
  3308.     End Property
  3309.  
  3310.     <Category("Colours")>
  3311.     Public Property FontColour As Color
  3312.         Get
  3313.             Return _FontColour
  3314.         End Get
  3315.         Set(value As Color)
  3316.             _FontColour = value
  3317.         End Set
  3318.     End Property
  3319.  
  3320. #End Region
  3321.  
  3322. #Region "Events"
  3323.  
  3324.     Protected Overrides Sub OnResize(e As EventArgs)
  3325.         MyBase.OnResize(e)
  3326.         Height = 25
  3327.     End Sub
  3328.  
  3329.     Protected Overrides Sub CreateHandle()
  3330.         MyBase.CreateHandle()
  3331.         Height = 25
  3332.     End Sub
  3333.  
  3334.     Public Sub Increment(ByVal Amount As Integer)
  3335.         Value += Amount
  3336.     End Sub
  3337.  
  3338. #End Region
  3339.  
  3340. #Region "Draw Control"
  3341.     Sub New()
  3342.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  3343.                  ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer, True)
  3344.         DoubleBuffered = True
  3345.     End Sub
  3346.  
  3347.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  3348.         Dim G = e.Graphics
  3349.         Dim Base As New Rectangle(0, 0, Width, Height)
  3350.         With G
  3351.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  3352.             .SmoothingMode = SmoothingMode.HighQuality
  3353.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  3354.             .Clear(BackColor)
  3355.             Dim ProgVal As Integer = CInt(_Value / _Maximum * Width)
  3356.             Select Case Value
  3357.                 Case 0
  3358.                     .FillRectangle(New SolidBrush(_BaseColour), Base)
  3359.                     .FillRectangle(New SolidBrush(_ProgressColour), New Rectangle(0, 0, ProgVal - 1, Height))
  3360.                     .DrawRectangle(New Pen(_BorderColour, 3), Base)
  3361.                 Case _Maximum
  3362.                     .FillRectangle(New SolidBrush(_BaseColour), Base)
  3363.                     .FillRectangle(New SolidBrush(_ProgressColour), New Rectangle(0, 0, ProgVal - 1, Height))
  3364.                     If _TwoColour Then
  3365.                         G.SetClip(New Rectangle(0, -10, CInt(Width * _Value / _Maximum - 1), Height - 5))
  3366.                         For i = 0 To (Width - 1) * _Maximum / _Value Step 25
  3367.                             G.DrawLine(New Pen(New SolidBrush(_SecondColour), 7), New Point(CInt(i), 0), New Point(CInt(i - 15), Height))
  3368.                         Next
  3369.                         G.ResetClip()
  3370.                     Else
  3371.                     End If
  3372.                     .DrawRectangle(New Pen(_BorderColour, 3), Base)
  3373.                 Case Else
  3374.                     .FillRectangle(New SolidBrush(_BaseColour), Base)
  3375.                     .FillRectangle(New SolidBrush(_ProgressColour), New Rectangle(0, 0, ProgVal - 1, Height))
  3376.                     If _TwoColour Then
  3377.                         .SetClip(New Rectangle(0, 0, CInt(Width * _Value / _Maximum - 1), Height - 1))
  3378.                         For i = 0 To (Width - 1) * _Maximum / _Value Step 25
  3379.                             .DrawLine(New Pen(New SolidBrush(_SecondColour), 7), New Point(CInt(i), 0), New Point(CInt(i - 10), Height))
  3380.                         Next
  3381.                         .ResetClip()
  3382.                     Else
  3383.                     End If
  3384.                     .DrawRectangle(New Pen(_BorderColour, 3), Base)
  3385.             End Select
  3386.             .InterpolationMode = CType(7, InterpolationMode)
  3387.         End With
  3388.     End Sub
  3389.  
  3390. #End Region
  3391.  
  3392. End Class
  3393.  
  3394. Public Class LogInRichTextBox
  3395.     Inherits Control
  3396.  
  3397. #Region "Declarations"
  3398.     Private WithEvents TB As New RichTextBox
  3399.     Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
  3400.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  3401.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  3402. #End Region
  3403.  
  3404. #Region "Properties"
  3405.  
  3406.     <Category("Colours")>
  3407.     Public Property BaseColour As Color
  3408.         Get
  3409.             Return _BaseColour
  3410.         End Get
  3411.         Set(value As Color)
  3412.             _BaseColour = value
  3413.         End Set
  3414.     End Property
  3415.  
  3416.     <Category("Colours")>
  3417.     Public Property BorderColour As Color
  3418.         Get
  3419.             Return _BorderColour
  3420.         End Get
  3421.         Set(value As Color)
  3422.             _BorderColour = value
  3423.         End Set
  3424.     End Property
  3425.  
  3426.     <Category("Colours")>
  3427.     Public Property TextColour As Color
  3428.         Get
  3429.             Return _TextColour
  3430.         End Get
  3431.         Set(value As Color)
  3432.             _TextColour = value
  3433.         End Set
  3434.     End Property
  3435.  
  3436. #End Region
  3437.  
  3438. #Region "Events"
  3439.  
  3440.     Public Sub AppendText(ByVal AppendingText As String)
  3441.         TB.Focus()
  3442.         TB.AppendText(AppendingText)
  3443.         Invalidate()
  3444.     End Sub
  3445.  
  3446.     Overrides Property Text As String
  3447.         Get
  3448.             Return TB.Text
  3449.         End Get
  3450.         Set(value As String)
  3451.             TB.Text = value
  3452.             Invalidate()
  3453.         End Set
  3454.     End Property
  3455.  
  3456.     Protected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)
  3457.         MyBase.OnBackColorChanged(e)
  3458.         TB.BackColor = BackColor
  3459.         Invalidate()
  3460.     End Sub
  3461.  
  3462.     Protected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)
  3463.         MyBase.OnForeColorChanged(e)
  3464.         TB.ForeColor = ForeColor
  3465.         Invalidate()
  3466.     End Sub
  3467.  
  3468.     Protected Overrides Sub OnSizeChanged(ByVal e As System.EventArgs)
  3469.         MyBase.OnSizeChanged(e)
  3470.         TB.Size = New Size(Width - 10, Height - 11)
  3471.     End Sub
  3472.  
  3473.     Protected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)
  3474.         MyBase.OnFontChanged(e)
  3475.         TB.Font = Font
  3476.     End Sub
  3477.  
  3478.     Sub TextChanges() Handles MyBase.TextChanged
  3479.         TB.Text = Text
  3480.     End Sub
  3481.  
  3482. #End Region
  3483.  
  3484. #Region "Draw Control"
  3485.  
  3486.     Sub New()
  3487.         With TB
  3488.             .Multiline = True
  3489.             .BackColor = _BaseColour
  3490.             .ForeColor = _TextColour
  3491.             .Text = String.Empty
  3492.             .BorderStyle = BorderStyle.None
  3493.             .Location = New Point(5, 5)
  3494.             .Font = New Font("Segeo UI", 9)
  3495.             .Size = New Size(Width - 10, Height - 10)
  3496.         End With
  3497.         Controls.Add(TB)
  3498.         Size = New Size(135, 35)
  3499.         DoubleBuffered = True
  3500.     End Sub
  3501.  
  3502.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  3503.         Dim g = e.Graphics
  3504.         Dim Base As New Rectangle(0, 0, Width - 1, Height - 1)
  3505.         With G
  3506.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  3507.             .SmoothingMode = SmoothingMode.HighQuality
  3508.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  3509.             .Clear(_BaseColour)
  3510.             .DrawRectangle(New Pen(_BorderColour, 2), ClientRectangle)
  3511.             .InterpolationMode = CType(7, InterpolationMode)
  3512.         End With
  3513.     End Sub
  3514.  
  3515. #End Region
  3516.  
  3517. End Class
  3518.  
  3519. Public Class LogInStatusBar
  3520.     Inherits Control
  3521.  
  3522. #Region "Variables"
  3523.     Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
  3524.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  3525.     Private _TextColour As Color = Color.White
  3526.     Private _RectColour As Color = Color.FromArgb(21, 117, 149)
  3527.     Private _ShowLine As Boolean = True
  3528.     Private _LinesToShow As LinesCount = LinesCount.One
  3529.     Private _Alignment As Alignments = Alignments.Left
  3530.     Private _ShowBorder As Boolean = True
  3531. #End Region
  3532.  
  3533. #Region "Properties"
  3534.  
  3535.     <Category("Colours")>
  3536.     Public Property BaseColour As Color
  3537.         Get
  3538.             Return _BaseColour
  3539.         End Get
  3540.         Set(value As Color)
  3541.             _BaseColour = value
  3542.         End Set
  3543.     End Property
  3544.  
  3545.     <Category("Colours")>
  3546.     Public Property BorderColour As Color
  3547.         Get
  3548.             Return _BorderColour
  3549.         End Get
  3550.         Set(value As Color)
  3551.             _BorderColour = value
  3552.         End Set
  3553.     End Property
  3554.  
  3555.     <Category("Colours")>
  3556.     Public Property TextColour As Color
  3557.         Get
  3558.             Return _TextColour
  3559.         End Get
  3560.         Set(value As Color)
  3561.             _TextColour = value
  3562.         End Set
  3563.     End Property
  3564.  
  3565.     Enum LinesCount As Integer
  3566.         One = 1
  3567.         Two = 2
  3568.     End Enum
  3569.  
  3570.     Enum Alignments
  3571.         Left
  3572.         Center
  3573.         Right
  3574.     End Enum
  3575.  
  3576.     <Category("Control")>
  3577.     Public Property Alignment As Alignments
  3578.         Get
  3579.             Return _Alignment
  3580.         End Get
  3581.         Set(value As Alignments)
  3582.             _Alignment = value
  3583.         End Set
  3584.     End Property
  3585.  
  3586.     <Category("Control")>
  3587.     Public Property LinesToShow As LinesCount
  3588.         Get
  3589.             Return _LinesToShow
  3590.         End Get
  3591.         Set(value As LinesCount)
  3592.             _LinesToShow = value
  3593.         End Set
  3594.     End Property
  3595.  
  3596.     Public Property ShowBorder As Boolean
  3597.         Get
  3598.             Return _ShowBorder
  3599.         End Get
  3600.         Set(value As Boolean)
  3601.             _ShowBorder = value
  3602.         End Set
  3603.     End Property
  3604.  
  3605.     Protected Overrides Sub CreateHandle()
  3606.         MyBase.CreateHandle()
  3607.         Dock = DockStyle.Bottom
  3608.     End Sub
  3609.  
  3610.     Protected Overrides Sub OnTextChanged(e As EventArgs)
  3611.         MyBase.OnTextChanged(e) : Invalidate()
  3612.     End Sub
  3613.  
  3614.     <Category("Colours")> _
  3615.     Public Property RectangleColor As Color
  3616.         Get
  3617.             Return _RectColour
  3618.         End Get
  3619.         Set(value As Color)
  3620.             _RectColour = value
  3621.         End Set
  3622.     End Property
  3623.  
  3624.     Public Property ShowLine As Boolean
  3625.         Get
  3626.             Return _ShowLine
  3627.         End Get
  3628.         Set(value As Boolean)
  3629.             _ShowLine = value
  3630.         End Set
  3631.     End Property
  3632.  
  3633. #End Region
  3634.  
  3635. #Region "Draw Control"
  3636.  
  3637.     Sub New()
  3638.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  3639.                  ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer, True)
  3640.         DoubleBuffered = True
  3641.         Font = New Font("Segoe UI", 9)
  3642.         ForeColor = Color.White
  3643.         Size = New Size(Width, 20)
  3644.     End Sub
  3645.  
  3646.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  3647.         Dim G = e.Graphics
  3648.         Dim Base As New Rectangle(0, 0, Width, Height)
  3649.         With G
  3650.             .SmoothingMode = SmoothingMode.HighQuality
  3651.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  3652.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  3653.             .Clear(BaseColour)
  3654.             .FillRectangle(New SolidBrush(BaseColour), Base)
  3655.             If _ShowLine = True Then
  3656.                 Select Case _LinesToShow
  3657.                     Case LinesCount.One
  3658.                         If _Alignment = Alignments.Left Then
  3659.                             .DrawString(Text, Font, New SolidBrush(_TextColour), New Rectangle(22, 2, Width, Height), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Near})
  3660.                         ElseIf _Alignment = Alignments.Center Then
  3661.                             .DrawString(Text, Font, New SolidBrush(_TextColour), New Rectangle(0, 0, Width, Height), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  3662.                         Else
  3663.                             .DrawString(Text, Font, New SolidBrush(_TextColour), New Rectangle(0, 0, Width - 5, Height), New StringFormat With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  3664.                         End If
  3665.                         .FillRectangle(New SolidBrush(_RectColour), New Rectangle(5, 9, 14, 3))
  3666.                     Case LinesCount.Two
  3667.                         If _Alignment = Alignments.Left Then
  3668.                             .DrawString(Text, Font, New SolidBrush(_TextColour), New Rectangle(22, 2, Width, Height), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Near})
  3669.                         ElseIf _Alignment = Alignments.Center Then
  3670.                             .DrawString(Text, Font, New SolidBrush(_TextColour), New Rectangle(0, 0, Width, Height), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  3671.                         Else
  3672.                             .DrawString(Text, Font, New SolidBrush(_TextColour), New Rectangle(0, 0, Width - 22, Height), New StringFormat With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  3673.                         End If
  3674.                         .FillRectangle(New SolidBrush(_RectColour), New Rectangle(5, 9, 14, 3))
  3675.                         .FillRectangle(New SolidBrush(_RectColour), New Rectangle(Width - 20, 9, 14, 3))
  3676.                 End Select
  3677.             Else
  3678.                 .DrawString(Text, Font, Brushes.White, New Rectangle(5, 2, Width, Height), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Near})
  3679.             End If
  3680.             If _ShowBorder Then
  3681.                 .DrawLine(New Pen(_BorderColour, 2), New Point(0, 0), New Point(Width, 0))
  3682.             Else
  3683.             End If
  3684.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  3685.         End With
  3686.     End Sub
  3687.  
  3688. #End Region
  3689.  
  3690. End Class
  3691.  
  3692. <DefaultEvent("ToggleChanged")>
  3693. Public Class LogInOnOffSwitch
  3694.     Inherits Control
  3695.  
  3696. #Region "Declarations"
  3697.  
  3698.     Event ToggleChanged(ByVal sender As Object)
  3699.     Private _Toggled As Toggles = Toggles.NotToggled
  3700.     Private MouseXLoc As Integer
  3701.     Private ToggleLocation As Integer = 0
  3702.     Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
  3703.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  3704.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  3705.     Private _NonToggledTextColour As Color = Color.FromArgb(125, 125, 125)
  3706.     Private _ToggledColour As Color = Color.FromArgb(23, 119, 151)
  3707.  
  3708. #End Region
  3709.  
  3710. #Region "Properties & Events"
  3711.  
  3712.     <Category("Colours")>
  3713.     Public Property BaseColour As Color
  3714.         Get
  3715.             Return _BaseColour
  3716.         End Get
  3717.         Set(value As Color)
  3718.             _BaseColour = value
  3719.             Invalidate()
  3720.         End Set
  3721.     End Property
  3722.  
  3723.     <Category("Colours")>
  3724.     Public Property BorderColour As Color
  3725.         Get
  3726.             Return _BorderColour
  3727.         End Get
  3728.         Set(value As Color)
  3729.             _BorderColour = value
  3730.             Invalidate()
  3731.         End Set
  3732.     End Property
  3733.  
  3734.     <Category("Colours")>
  3735.     Public Property TextColour As Color
  3736.         Get
  3737.             Return _TextColour
  3738.         End Get
  3739.         Set(value As Color)
  3740.             _TextColour = value
  3741.             Invalidate()
  3742.         End Set
  3743.     End Property
  3744.  
  3745.     <Category("Colours")>
  3746.     Public Property NonToggledTextColourderColour As Color
  3747.         Get
  3748.             Return _NonToggledTextColour
  3749.         End Get
  3750.         Set(value As Color)
  3751.             _NonToggledTextColour = value
  3752.             Invalidate()
  3753.         End Set
  3754.     End Property
  3755.  
  3756.     <Category("Colours")>
  3757.     Public Property ToggledColour As Color
  3758.         Get
  3759.             Return _ToggledColour
  3760.         End Get
  3761.         Set(value As Color)
  3762.             _ToggledColour = value
  3763.             Invalidate()
  3764.         End Set
  3765.     End Property
  3766.  
  3767.     Enum Toggles
  3768.         Toggled
  3769.         NotToggled
  3770.     End Enum
  3771.  
  3772.     Event ToggledChanged()
  3773.  
  3774.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  3775.         MyBase.OnMouseMove(e)
  3776.         MouseXLoc = e.Location.X
  3777.         Invalidate()
  3778.         If e.X < Width - 40 AndAlso e.X > 40 Then Cursor = Cursors.IBeam Else Cursor = Cursors.Arrow
  3779.     End Sub
  3780.  
  3781.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  3782.         MyBase.OnMouseDown(e)
  3783.         If MouseXLoc > Width - 39 Then
  3784.             _Toggled = Toggles.Toggled
  3785.             ToggledValue()
  3786.         ElseIf MouseXLoc < 39 Then
  3787.             _Toggled = Toggles.NotToggled
  3788.             ToggledValue()
  3789.         End If
  3790.         Invalidate()
  3791.     End Sub
  3792.  
  3793.     Public Property Toggled() As Toggles
  3794.         Get
  3795.             Return _Toggled
  3796.         End Get
  3797.         Set(ByVal value As Toggles)
  3798.             _Toggled = value
  3799.             Invalidate()
  3800.         End Set
  3801.     End Property
  3802.  
  3803.     Private Sub ToggledValue()
  3804.         If CBool(_Toggled) Then
  3805.             If ToggleLocation < 100 Then
  3806.                 ToggleLocation += 10
  3807.             End If
  3808.         Else
  3809.             If ToggleLocation > 0 Then
  3810.                 ToggleLocation -= 10
  3811.             End If
  3812.         End If
  3813.         Invalidate()
  3814.     End Sub
  3815.  
  3816. #End Region
  3817.  
  3818. #Region "Draw Control"
  3819.  
  3820.     Sub New()
  3821.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
  3822.                 ControlStyles.UserPaint Or ControlStyles.DoubleBuffer, True)
  3823.         BackColor = Color.FromArgb(54, 54, 54)
  3824.     End Sub
  3825.  
  3826.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  3827.  
  3828.         Dim G As Graphics = e.Graphics
  3829.         With G
  3830.             .Clear(BackColor)
  3831.             .SmoothingMode = SmoothingMode.HighQuality
  3832.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  3833.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  3834.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  3835.             .FillRectangle(New SolidBrush(_BaseColour), New Rectangle(0, 0, 39, Height))
  3836.             .FillRectangle(New SolidBrush(_BaseColour), New Rectangle(Width - 40, 0, Width, Height))
  3837.             .FillRectangle(New SolidBrush(_BaseColour), New Rectangle(38, 9, Width - 40, 5))
  3838.             Dim P As Point() = {New Point(0, 0), New Point(39, 0), New Point(39, 9), New Point(Width - 40, 9), New Point(Width - 40, 0), _
  3839.                                New Point(Width - 2, 0), New Point(Width - 2, Height - 1), New Point(Width - 40, Height - 1), _
  3840.                                 New Point(Width - 40, 14), New Point(39, 14), New Point(39, Height - 1), New Point(0, Height - 1), New Point()}
  3841.             .DrawLines(New Pen(_BorderColour, 2), P)
  3842.             If _Toggled = Toggles.Toggled Then
  3843.                 .FillRectangle(New SolidBrush(_ToggledColour), New Rectangle(CInt(Width / 2), 10, CInt(Width / 2 - 38), 3))
  3844.                 .FillRectangle(New SolidBrush(_ToggledColour), New Rectangle(Width - 39, 2, 36, Height - 5))
  3845.                 .DrawString("ON", New Font("Microsoft Sans Serif", 7, FontStyle.Bold), New SolidBrush(_TextColour), New Rectangle(2, -1, CInt(Width - 20 + 20 / 3), Height), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  3846.                 .DrawString("OFF", New Font("Microsoft Sans Serif", 7, FontStyle.Bold), New SolidBrush(_NonToggledTextColour), New Rectangle(CInt(20 - 20 / 3 - 6), -1, CInt(Width - 20 + 20 / 3), Height), New StringFormat() With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center})
  3847.             ElseIf _Toggled = Toggles.NotToggled Then
  3848.                 .DrawString("OFF", New Font("Microsoft Sans Serif", 7, FontStyle.Bold), New SolidBrush(_TextColour), New Rectangle(CInt(20 - 20 / 3 - 6), -1, CInt(Width - 20 + 20 / 3), Height), New StringFormat() With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center})
  3849.                 .DrawString("ON", New Font("Microsoft Sans Serif", 7, FontStyle.Bold), New SolidBrush(_NonToggledTextColour), New Rectangle(2, -1, CInt(Width - 20 + 20 / 3), Height), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
  3850.             End If
  3851.             .DrawLine(New Pen(_BorderColour, 2), New Point(CInt(Width / 2), 0), New Point(CInt(Width / 2), Height))
  3852.  
  3853.         End With
  3854.     End Sub
  3855.  
  3856. #End Region
  3857.  
  3858. End Class
  3859.  
  3860. Public Class LogInComboBox
  3861.     Inherits ComboBox
  3862.  
  3863. #Region "Declarations"
  3864.     Private _StartIndex As Integer = 0
  3865.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  3866.     Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
  3867.     Private _FontColour As Color = Color.FromArgb(255, 255, 255)
  3868.     Private _LineColour As Color = Color.FromArgb(23, 119, 151)
  3869.     Private _SqaureColour As Color = Color.FromArgb(47, 47, 47)
  3870.     Private _ArrowColour As Color = Color.FromArgb(30, 30, 30)
  3871.     Private _SqaureHoverColour As Color = Color.FromArgb(52, 52, 52)
  3872.     Private State As MouseState = MouseState.None
  3873. #End Region
  3874.  
  3875. #Region "Properties & Events"
  3876.  
  3877.     <Category("Colours")>
  3878.     Public Property LineColour As Color
  3879.         Get
  3880.             Return _LineColour
  3881.         End Get
  3882.         Set(value As Color)
  3883.             _LineColour = value
  3884.         End Set
  3885.     End Property
  3886.  
  3887.     <Category("Colours")>
  3888.     Public Property SqaureColour As Color
  3889.         Get
  3890.             Return _SqaureColour
  3891.         End Get
  3892.         Set(value As Color)
  3893.             _SqaureColour = value
  3894.         End Set
  3895.     End Property
  3896.  
  3897.     <Category("Colours")>
  3898.     Public Property ArrowColour As Color
  3899.         Get
  3900.             Return _ArrowColour
  3901.         End Get
  3902.         Set(value As Color)
  3903.             _ArrowColour = value
  3904.         End Set
  3905.     End Property
  3906.  
  3907.     <Category("Colours")>
  3908.     Public Property SqaureHoverColour As Color
  3909.         Get
  3910.             Return _SqaureHoverColour
  3911.         End Get
  3912.         Set(value As Color)
  3913.             _SqaureHoverColour = value
  3914.         End Set
  3915.     End Property
  3916.  
  3917.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  3918.         MyBase.OnMouseEnter(e)
  3919.         State = MouseState.Over : Invalidate()
  3920.     End Sub
  3921.  
  3922.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  3923.         MyBase.OnMouseLeave(e)
  3924.         State = MouseState.None : Invalidate()
  3925.     End Sub
  3926.  
  3927.     <Category("Colours")>
  3928.     Public Property BorderColour As Color
  3929.         Get
  3930.             Return _BorderColour
  3931.         End Get
  3932.         Set(value As Color)
  3933.             _BorderColour = value
  3934.         End Set
  3935.     End Property
  3936.  
  3937.     <Category("Colours")>
  3938.     Public Property BaseColour As Color
  3939.         Get
  3940.             Return _BaseColour
  3941.         End Get
  3942.         Set(value As Color)
  3943.             _BaseColour = value
  3944.         End Set
  3945.     End Property
  3946.  
  3947.     <Category("Colours")>
  3948.     Public Property FontColour As Color
  3949.         Get
  3950.             Return _FontColour
  3951.         End Get
  3952.         Set(value As Color)
  3953.             _FontColour = value
  3954.         End Set
  3955.     End Property
  3956.  
  3957.     Public Property StartIndex As Integer
  3958.         Get
  3959.             Return _StartIndex
  3960.         End Get
  3961.         Set(ByVal value As Integer)
  3962.             _StartIndex = value
  3963.             Try
  3964.                 MyBase.SelectedIndex = value
  3965.             Catch
  3966.             End Try
  3967.             Invalidate()
  3968.         End Set
  3969.     End Property
  3970.  
  3971.     Protected Overrides Sub OnTextChanged(e As System.EventArgs)
  3972.         MyBase.OnTextChanged(e)
  3973.         Invalidate()
  3974.     End Sub
  3975.  
  3976.     Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  3977.         Invalidate()
  3978.         OnMouseClick(e)
  3979.     End Sub
  3980.  
  3981.     Protected Overrides Sub OnMouseUp(e As System.Windows.Forms.MouseEventArgs)
  3982.         Invalidate()
  3983.         MyBase.OnMouseUp(e)
  3984.     End Sub
  3985.  
  3986. #End Region
  3987.  
  3988. #Region "Draw Control"
  3989.  
  3990.     Sub ReplaceItem(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles Me.DrawItem
  3991.         e.DrawBackground()
  3992.         e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  3993.         Dim Rect As New Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width + 1, e.Bounds.Height + 1)
  3994.         Try
  3995.             With e.Graphics
  3996.                 If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then
  3997.                     .FillRectangle(New SolidBrush(_SqaureColour), Rect)
  3998.                     .DrawString(MyBase.GetItemText(MyBase.Items(e.Index)), Font, New SolidBrush(_FontColour), 1, e.Bounds.Top + 2)
  3999.                 Else
  4000.                     .FillRectangle(New SolidBrush(_BaseColour), Rect)
  4001.                     .DrawString(MyBase.GetItemText(MyBase.Items(e.Index)), Font, New SolidBrush(_FontColour), 1, e.Bounds.Top + 2)
  4002.                 End If
  4003.             End With
  4004.         Catch
  4005.         End Try
  4006.         e.DrawFocusRectangle()
  4007.         Invalidate()
  4008.  
  4009.     End Sub
  4010.  
  4011.     Sub New()
  4012.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  4013.                ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  4014.                ControlStyles.SupportsTransparentBackColor, True)
  4015.         DoubleBuffered = True
  4016.         BackColor = Color.Transparent
  4017.         DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
  4018.         DropDownStyle = ComboBoxStyle.DropDownList
  4019.         Width = 163
  4020.         Font = New Font("Segoe UI", 10)
  4021.     End Sub
  4022.  
  4023.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  4024.         Dim g = e.Graphics
  4025.         With G
  4026.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  4027.             .SmoothingMode = SmoothingMode.HighQuality
  4028.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  4029.             .Clear(BackColor)
  4030.             Try
  4031.                 Dim Square As New Rectangle(Width - 25, 0, Width, Height)
  4032.                 .FillRectangle(New SolidBrush(_BaseColour), New Rectangle(0, 0, Width - 25, Height))
  4033.                 Select Case State
  4034.                     Case MouseState.None
  4035.                         .FillRectangle(New SolidBrush(_SqaureColour), Square)
  4036.                     Case MouseState.Over
  4037.                         .FillRectangle(New SolidBrush(_SqaureHoverColour), Square)
  4038.                 End Select
  4039.                 .DrawLine(New Pen(_LineColour, 2), New Point(Width - 26, 1), New Point(Width - 26, Height - 1))
  4040.                 Try
  4041.                     .DrawString(Text, Font, New SolidBrush(_FontColour), New Rectangle(3, 0, Width - 20, Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Near})
  4042.                 Catch : End Try
  4043.                 .DrawRectangle(New Pen(_BorderColour, 2), New Rectangle(0, 0, Width, Height))
  4044.                 Dim P() As Point = {New Point(Width - 17, 11), New Point(Width - 13, 5), New Point(Width - 9, 11)}
  4045.                 .FillPolygon(New SolidBrush(_BorderColour), P)
  4046.                 .DrawPolygon(New Pen(_ArrowColour), P)
  4047.                 Dim P1() As Point = {New Point(Width - 17, 15), New Point(Width - 13, 21), New Point(Width - 9, 15)}
  4048.                 .FillPolygon(New SolidBrush(_BorderColour), P1)
  4049.                 .DrawPolygon(New Pen(_ArrowColour), P1)
  4050.             Catch
  4051.             End Try
  4052.             .InterpolationMode = CType(7, InterpolationMode)
  4053.         End With
  4054.  
  4055.     End Sub
  4056.  
  4057. #End Region
  4058.  
  4059. End Class
  4060.  
  4061. Public Class LogInTabControl
  4062.     Inherits TabControl
  4063.  
  4064. #Region "Declarations"
  4065.  
  4066.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  4067.     Private _BackTabColour As Color = Color.FromArgb(54, 54, 54)
  4068.     Private _BaseColour As Color = Color.FromArgb(35, 35, 35)
  4069.     Private _ActiveColour As Color = Color.FromArgb(47, 47, 47)
  4070.     Private _BorderColour As Color = Color.FromArgb(30, 30, 30)
  4071.     Private _UpLineColour As Color = Color.FromArgb(0, 160, 199)
  4072.     Private _HorizLineColour As Color = Color.FromArgb(23, 119, 151)
  4073.     Private CenterSF As New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center}
  4074.  
  4075. #End Region
  4076.  
  4077. #Region "Properties"
  4078.  
  4079.     <Category("Colours")> _
  4080.     Public Property BorderColour As Color
  4081.         Get
  4082.             Return _BorderColour
  4083.         End Get
  4084.         Set(value As Color)
  4085.             _BorderColour = value
  4086.         End Set
  4087.     End Property
  4088.  
  4089.     <Category("Colours")> _
  4090.     Public Property UpLineColour As Color
  4091.         Get
  4092.             Return _UpLineColour
  4093.         End Get
  4094.         Set(value As Color)
  4095.             _UpLineColour = value
  4096.         End Set
  4097.     End Property
  4098.  
  4099.     <Category("Colours")> _
  4100.     Public Property HorizontalLineColour As Color
  4101.         Get
  4102.             Return _HorizLineColour
  4103.         End Get
  4104.         Set(value As Color)
  4105.             _HorizLineColour = value
  4106.         End Set
  4107.     End Property
  4108.  
  4109.     <Category("Colours")> _
  4110.     Public Property TextColour As Color
  4111.         Get
  4112.             Return _TextColour
  4113.         End Get
  4114.         Set(value As Color)
  4115.             _TextColour = value
  4116.         End Set
  4117.     End Property
  4118.  
  4119.     <Category("Colours")> _
  4120.     Public Property BackTabColour As Color
  4121.         Get
  4122.             Return _BackTabColour
  4123.         End Get
  4124.         Set(value As Color)
  4125.             _BackTabColour = value
  4126.         End Set
  4127.     End Property
  4128.  
  4129.     <Category("Colours")> _
  4130.     Public Property BaseColour As Color
  4131.         Get
  4132.             Return _BaseColour
  4133.         End Get
  4134.         Set(value As Color)
  4135.             _BaseColour = value
  4136.         End Set
  4137.     End Property
  4138.  
  4139.     <Category("Colours")> _
  4140.     Public Property ActiveColour As Color
  4141.         Get
  4142.             Return _ActiveColour
  4143.         End Get
  4144.         Set(value As Color)
  4145.             _ActiveColour = value
  4146.         End Set
  4147.     End Property
  4148.  
  4149.     Protected Overrides Sub CreateHandle()
  4150.         MyBase.CreateHandle()
  4151.         Alignment = TabAlignment.Top
  4152.     End Sub
  4153.  
  4154. #End Region
  4155.  
  4156. #Region "Draw Control"
  4157.  
  4158.     Sub New()
  4159.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
  4160.                  ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer, True)
  4161.         DoubleBuffered = True
  4162.         Font = New Font("Segoe UI", 10)
  4163.         SizeMode = TabSizeMode.Normal
  4164.         ItemSize = New Size(240, 32)
  4165.     End Sub
  4166.  
  4167.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  4168.         Dim g = e.Graphics
  4169.         With G
  4170.             .SmoothingMode = SmoothingMode.HighQuality
  4171.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  4172.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  4173.             .Clear(_BaseColour)
  4174.             Try : SelectedTab.BackColor = _BackTabColour : Catch : End Try
  4175.             Try : SelectedTab.BorderStyle = BorderStyle.FixedSingle : Catch : End Try
  4176.             .DrawRectangle(New Pen(_BorderColour, 2), New Rectangle(0, 0, Width, Height))
  4177.             For i = 0 To TabCount - 1
  4178.                 Dim Base As New Rectangle(New Point(GetTabRect(i).Location.X, GetTabRect(i).Location.Y), New Size(GetTabRect(i).Width, GetTabRect(i).Height))
  4179.                 Dim BaseSize As New Rectangle(Base.Location, New Size(Base.Width, Base.Height))
  4180.                 If i = SelectedIndex Then
  4181.                     .FillRectangle(New SolidBrush(_BaseColour), BaseSize)
  4182.                     .FillRectangle(New SolidBrush(_ActiveColour), New Rectangle(Base.X + 1, Base.Y - 3, Base.Width, Base.Height + 5))
  4183.                     .DrawString(TabPages(i).Text, Font, New SolidBrush(_TextColour), New Rectangle(Base.X + 7, Base.Y, Base.Width - 3, Base.Height), CenterSF)
  4184.                     .DrawLine(New Pen(_HorizLineColour, 2), New Point(Base.X + 3, CInt(Base.Height / 2 + 2)), New Point(Base.X + 9, CInt(Base.Height / 2 + 2)))
  4185.                     .DrawLine(New Pen(_UpLineColour, 2), New Point(Base.X + 3, Base.Y - 3), New Point(Base.X + 3, Base.Height + 5))
  4186.                 Else
  4187.                     .DrawString(TabPages(i).Text, Font, New SolidBrush(_TextColour), BaseSize, CenterSF)
  4188.                 End If
  4189.             Next
  4190.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  4191.         End With
  4192.     End Sub
  4193.  
  4194. #End Region
  4195.  
  4196. End Class
  4197.  
  4198. Public Class LogInTrackBar
  4199.     Inherits Control
  4200.  
  4201. #Region "Declaration"
  4202.     Private _Maximum As Integer = 10
  4203.     Private _Value As Integer = 0
  4204.     Private CaptureMovement As Boolean = False
  4205.     Private Bar As Rectangle = New Rectangle(0, 10, Width - 21, Height - 21)
  4206.     Private Track As Size = New Size(25, 14)
  4207.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  4208.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  4209.     Private _BarBaseColour As Color = Color.FromArgb(47, 47, 47)
  4210.     Private _StripColour As Color = Color.FromArgb(42, 42, 42)
  4211.     Private _StripAmountColour As Color = Color.FromArgb(23, 119, 151)
  4212. #End Region
  4213.  
  4214. #Region "Properties"
  4215.  
  4216.     <Category("Colours")> _
  4217.     Public Property BorderColour As Color
  4218.         Get
  4219.             Return _BorderColour
  4220.         End Get
  4221.         Set(value As Color)
  4222.             _BorderColour = value
  4223.         End Set
  4224.     End Property
  4225.  
  4226.     <Category("Colours")> _
  4227.     Public Property BarBaseColour As Color
  4228.         Get
  4229.             Return _BarBaseColour
  4230.         End Get
  4231.         Set(value As Color)
  4232.             _BarBaseColour = value
  4233.         End Set
  4234.     End Property
  4235.  
  4236.     <Category("Colours")> _
  4237.     Public Property StripColour As Color
  4238.         Get
  4239.             Return _StripColour
  4240.         End Get
  4241.         Set(value As Color)
  4242.             _StripColour = value
  4243.         End Set
  4244.     End Property
  4245.  
  4246.     <Category("Colours")> _
  4247.     Public Property TextColour As Color
  4248.         Get
  4249.             Return _TextColour
  4250.         End Get
  4251.         Set(value As Color)
  4252.             _TextColour = value
  4253.         End Set
  4254.     End Property
  4255.  
  4256.     <Category("Colours")> _
  4257.     Public Property StripAmountColour As Color
  4258.         Get
  4259.             Return _StripAmountColour
  4260.         End Get
  4261.         Set(value As Color)
  4262.             _StripAmountColour = value
  4263.         End Set
  4264.     End Property
  4265.  
  4266.     Public Property Maximum() As Integer
  4267.         Get
  4268.             Return _Maximum
  4269.         End Get
  4270.         Set(ByVal value As Integer)
  4271.             If value > 0 Then _Maximum = value
  4272.             If value < _Value Then _Value = value
  4273.             Invalidate()
  4274.         End Set
  4275.     End Property
  4276.  
  4277.     Event ValueChanged()
  4278.  
  4279.     Public Property Value() As Integer
  4280.         Get
  4281.             Return _Value
  4282.         End Get
  4283.         Set(ByVal value As Integer)
  4284.             Select Case value
  4285.                 Case Is = _Value
  4286.                     Exit Property
  4287.                 Case Is < 0
  4288.                     _Value = 0
  4289.                 Case Is > _Maximum
  4290.                     _Value = _Maximum
  4291.                 Case Else
  4292.                     _Value = value
  4293.             End Select
  4294.             Invalidate()
  4295.             RaiseEvent ValueChanged()
  4296.         End Set
  4297.     End Property
  4298.  
  4299.    
  4300.  
  4301.     Protected Overrides Sub OnMouseDown(ByVal e As Windows.Forms.MouseEventArgs)
  4302.         MyBase.OnMouseDown(e)
  4303.         Dim MovementPoint As New Rectangle(New Point(e.Location.X, e.Location.Y), New Size(1, 1))
  4304.         Dim Bar As New Rectangle(10, 10, Width - 21, Height - 21)
  4305.         If New Rectangle(New Point(Bar.X + CInt(Bar.Width * (Value / Maximum)) - CInt(Track.Width / 2 - 1), 0), New Size(Track.Width, Height)).IntersectsWith(MovementPoint) Then
  4306.             CaptureMovement = True
  4307.         End If
  4308.     End Sub
  4309.  
  4310.     Protected Overrides Sub OnMouseUp(ByVal e As Windows.Forms.MouseEventArgs)
  4311.         MyBase.OnMouseUp(e)
  4312.         CaptureMovement = False
  4313.     End Sub
  4314.  
  4315.     Protected Overrides Sub OnMouseMove(ByVal e As Windows.Forms.MouseEventArgs)
  4316.         MyBase.OnMouseMove(e)
  4317.         If CaptureMovement Then
  4318.             Dim MovementPoint As New Point(e.X, e.Y)
  4319.             Dim Bar As New Rectangle(10, 10, Width - 21, Height - 21)
  4320.             Value = CInt(Maximum * ((MovementPoint.X - Bar.X) / Bar.Width))
  4321.         End If
  4322.     End Sub
  4323.  
  4324.     Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs)
  4325.         MyBase.OnMouseLeave(e) : CaptureMovement = False
  4326.     End Sub
  4327.  
  4328. #End Region
  4329.  
  4330. #Region "Draw Control"
  4331.  
  4332.     Sub New()
  4333.         SetStyle(ControlStyles.OptimizedDoubleBuffer Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
  4334.                     ControlStyles.UserPaint Or ControlStyles.Selectable Or _
  4335.                     ControlStyles.SupportsTransparentBackColor, True)
  4336.         DoubleBuffered = True
  4337.         BackColor = Color.FromArgb(54, 54, 54)
  4338.     End Sub
  4339.  
  4340.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  4341.         Dim g = e.Graphics
  4342.         With G
  4343.             .SmoothingMode = SmoothingMode.AntiAlias
  4344.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  4345.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  4346.             Bar = New Rectangle(13, 11, Width - 27, Height - 21)
  4347.             .Clear(BackColor)
  4348.             .TextRenderingHint = TextRenderingHint.AntiAliasGridFit
  4349.             .FillRectangle(New SolidBrush(_StripColour), New Rectangle(3, CInt((Height / 2) - 4), Width - 5, 8))
  4350.             .DrawRectangle(New Pen(_BorderColour, 2), New Rectangle(4, CInt((Height / 2) - 4), Width - 5, 8))
  4351.             .FillRectangle(New SolidBrush(_StripAmountColour), New Rectangle(4, CInt((Height / 2) - 4), CInt(Bar.Width * (Value / Maximum)) + CInt(Track.Width / 2), 8))
  4352.             .FillRectangle(New SolidBrush(_BarBaseColour), Bar.X + CInt(Bar.Width * (Value / Maximum)) - CInt(Track.Width / 2), Bar.Y + CInt((Bar.Height / 2)) - CInt(Track.Height / 2), Track.Width, Track.Height)
  4353.             .DrawRectangle(New Pen(_BorderColour, 2), Bar.X + CInt(Bar.Width * (Value / Maximum)) - CInt(Track.Width / 2), Bar.Y + CInt((Bar.Height / 2)) - CInt(Track.Height / 2), Track.Width, Track.Height)
  4354.             .DrawString(CStr(_Value), New Font("Segoe UI", 6.5, FontStyle.Regular), New SolidBrush(_TextColour), New Rectangle(Bar.X + CInt(Bar.Width * (Value / Maximum)) - CInt(Track.Width / 2), Bar.Y + CInt((Bar.Height / 2)) - CInt(Track.Height / 2), Track.Width - 1, Track.Height), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  4355.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  4356.         End With
  4357.  
  4358.     End Sub
  4359.  
  4360. #End Region
  4361.  
  4362. End Class
  4363.  
  4364. <DefaultEvent("Scroll")>
  4365. Public Class LogInVerticalScrollBar
  4366.     Inherits Control
  4367.  
  4368. #Region "Declarations"
  4369.  
  4370.     Private ThumbMovement As Integer
  4371.     Private TSA As Rectangle
  4372.     Private BSA As Rectangle
  4373.     Private Shaft As Rectangle
  4374.     Private Thumb As Rectangle
  4375.     Private ShowThumb As Boolean
  4376.     Private ThumbPressed As Boolean
  4377.     Private _ThumbSize As Integer = 24
  4378.     Public _Minimum As Integer = 0
  4379.     Public _Maximum As Integer = 100
  4380.     Public _Value As Integer = 0
  4381.     Public _SmallChange As Integer = 1
  4382.     Private _ButtonSize As Integer = 16
  4383.     Public _LargeChange As Integer = 10
  4384.     Private _ThumbBorder As Color = Color.FromArgb(35, 35, 35)
  4385.     Private _LineColour As Color = Color.FromArgb(23, 119, 151)
  4386.     Private _ArrowColour As Color = Color.FromArgb(37, 37, 37)
  4387.     Private _BaseColour As Color = Color.FromArgb(47, 47, 47)
  4388.     Private _ThumbColour As Color = Color.FromArgb(55, 55, 55)
  4389.     Private _ThumbSecondBorder As Color = Color.FromArgb(65, 65, 65)
  4390.     Private _FirstBorder As Color = Color.FromArgb(55, 55, 55)
  4391.     Private _SecondBorder As Color = Color.FromArgb(35, 35, 35)
  4392.  
  4393. #End Region
  4394.  
  4395. #Region "Properties & Events"
  4396.  
  4397.     <Category("Colours")> _
  4398.     Public Property ThumbBorder As Color
  4399.         Get
  4400.             Return _ThumbBorder
  4401.         End Get
  4402.         Set(value As Color)
  4403.             _ThumbBorder = value
  4404.         End Set
  4405.     End Property
  4406.  
  4407.     <Category("Colours")> _
  4408.     Public Property LineColour As Color
  4409.         Get
  4410.             Return _LineColour
  4411.         End Get
  4412.         Set(value As Color)
  4413.             _LineColour = value
  4414.         End Set
  4415.     End Property
  4416.  
  4417.     <Category("Colours")> _
  4418.     Public Property ArrowColour As Color
  4419.         Get
  4420.             Return _ArrowColour
  4421.         End Get
  4422.         Set(value As Color)
  4423.             _ArrowColour = value
  4424.         End Set
  4425.     End Property
  4426.  
  4427.     <Category("Colours")> _
  4428.     Public Property BaseColour As Color
  4429.         Get
  4430.             Return _BaseColour
  4431.         End Get
  4432.         Set(value As Color)
  4433.             _BaseColour = value
  4434.         End Set
  4435.     End Property
  4436.  
  4437.     <Category("Colours")> _
  4438.     Public Property ThumbColour As Color
  4439.         Get
  4440.             Return _ThumbColour
  4441.         End Get
  4442.         Set(value As Color)
  4443.             _ThumbColour = value
  4444.         End Set
  4445.     End Property
  4446.  
  4447.     <Category("Colours")> _
  4448.     Public Property ThumbSecondBorder As Color
  4449.         Get
  4450.             Return _ThumbSecondBorder
  4451.         End Get
  4452.         Set(value As Color)
  4453.             _ThumbSecondBorder = value
  4454.         End Set
  4455.     End Property
  4456.  
  4457.     <Category("Colours")> _
  4458.     Public Property FirstBorder As Color
  4459.         Get
  4460.             Return _FirstBorder
  4461.         End Get
  4462.         Set(value As Color)
  4463.             _FirstBorder = value
  4464.         End Set
  4465.     End Property
  4466.  
  4467.     <Category("Colours")> _
  4468.     Public Property SecondBorder As Color
  4469.         Get
  4470.             Return _SecondBorder
  4471.         End Get
  4472.         Set(value As Color)
  4473.             _SecondBorder = value
  4474.         End Set
  4475.     End Property
  4476.  
  4477.     Event Scroll(ByVal sender As Object)
  4478.  
  4479.     Property Minimum() As Integer
  4480.         Get
  4481.             Return _Minimum
  4482.         End Get
  4483.         Set(ByVal value As Integer)
  4484.             _Minimum = value
  4485.             If value > _Value Then _Value = value
  4486.             If value > _Maximum Then _Maximum = value
  4487.             InvalidateLayout()
  4488.         End Set
  4489.     End Property
  4490.  
  4491.     Property Maximum() As Integer
  4492.         Get
  4493.             Return _Maximum
  4494.         End Get
  4495.         Set(ByVal value As Integer)
  4496.             If value < _Value Then _Value = value
  4497.             If value < _Minimum Then _Minimum = value
  4498.         End Set
  4499.     End Property
  4500.  
  4501.     Property Value() As Integer
  4502.         Get
  4503.             Return _Value
  4504.         End Get
  4505.         Set(ByVal value As Integer)
  4506.             Select Case value
  4507.                 Case Is = _Value
  4508.                     Exit Property
  4509.                 Case Is < _Minimum
  4510.                     _Value = _Minimum
  4511.                 Case Is > _Maximum
  4512.                     _Value = _Maximum
  4513.                 Case Else
  4514.                     _Value = value
  4515.             End Select
  4516.             InvalidatePosition()
  4517.             RaiseEvent Scroll(Me)
  4518.         End Set
  4519.     End Property
  4520.  
  4521.     Public Property SmallChange() As Integer
  4522.         Get
  4523.             Return _SmallChange
  4524.         End Get
  4525.         Set(ByVal value As Integer)
  4526.             Select Case value
  4527.                 Case Is < 1
  4528.                 Case Is >
  4529.                     CInt(_SmallChange = value)
  4530.             End Select
  4531.         End Set
  4532.     End Property
  4533.  
  4534.     Public Property LargeChange() As Integer
  4535.         Get
  4536.             Return _LargeChange
  4537.         End Get
  4538.         Set(ByVal value As Integer)
  4539.             Select Case value
  4540.                 Case Is < 1
  4541.                 Case Else
  4542.                     _LargeChange = value
  4543.             End Select
  4544.         End Set
  4545.     End Property
  4546.  
  4547.     Public Property ButtonSize As Integer
  4548.         Get
  4549.             Return _ButtonSize
  4550.         End Get
  4551.         Set(value As Integer)
  4552.             Select Case value
  4553.                 Case Is < 16
  4554.                     _ButtonSize = 16
  4555.                 Case Else
  4556.                     _ButtonSize = value
  4557.             End Select
  4558.         End Set
  4559.     End Property
  4560.  
  4561.     Protected Overrides Sub OnSizeChanged(e As EventArgs)
  4562.         InvalidateLayout()
  4563.     End Sub
  4564.  
  4565.     Private Sub InvalidateLayout()
  4566.         TSA = New Rectangle(0, 1, Width, 0)
  4567.         Shaft = New Rectangle(0, TSA.Bottom - 1, Width, Height - 3)
  4568.         ShowThumb = CBool(((_Maximum - _Minimum)))
  4569.         If ShowThumb Then
  4570.             Thumb = New Rectangle(1, 0, Width - 3, _ThumbSize)
  4571.         End If
  4572.         RaiseEvent Scroll(Me)
  4573.         InvalidatePosition()
  4574.     End Sub
  4575.  
  4576.     Private Sub InvalidatePosition()
  4577.         Thumb.Y = CInt(((_Value - _Minimum) / (_Maximum - _Minimum)) * (Shaft.Height - _ThumbSize) + 1)
  4578.         Invalidate()
  4579.     End Sub
  4580.  
  4581.     Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  4582.         If e.Button = Windows.Forms.MouseButtons.Left AndAlso ShowThumb Then
  4583.             If TSA.Contains(e.Location) Then
  4584.                 ThumbMovement = _Value - _SmallChange
  4585.             ElseIf BSA.Contains(e.Location) Then
  4586.                 ThumbMovement = _Value + _SmallChange
  4587.             Else
  4588.                 If Thumb.Contains(e.Location) Then
  4589.                     ThumbPressed = True
  4590.                     Return
  4591.                 Else
  4592.                     If e.Y < Thumb.Y Then
  4593.                         ThumbMovement = _Value - _LargeChange
  4594.                     Else
  4595.                         ThumbMovement = _Value + _LargeChange
  4596.                     End If
  4597.                 End If
  4598.             End If
  4599.             Value = Math.Min(Math.Max(ThumbMovement, _Minimum), _Maximum)
  4600.             InvalidatePosition()
  4601.         End If
  4602.     End Sub
  4603.  
  4604.     Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
  4605.         If ThumbPressed AndAlso ShowThumb Then
  4606.             Dim ThumbPosition As Integer = e.Y - TSA.Height - (_ThumbSize \ 2)
  4607.             Dim ThumbBounds As Integer = Shaft.Height - _ThumbSize
  4608.             ThumbMovement = CInt((ThumbPosition / ThumbBounds) * (_Maximum - _Minimum)) + _Minimum
  4609.             Value = Math.Min(Math.Max(ThumbMovement, _Minimum), _Maximum)
  4610.             InvalidatePosition()
  4611.         End If
  4612.     End Sub
  4613.  
  4614.     Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs)
  4615.         ThumbPressed = False
  4616.     End Sub
  4617.  
  4618. #End Region
  4619.  
  4620. #Region "Draw Control"
  4621.  
  4622.     Sub New()
  4623.         SetStyle(ControlStyles.OptimizedDoubleBuffer Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
  4624.                             ControlStyles.UserPaint Or ControlStyles.Selectable Or _
  4625.                             ControlStyles.SupportsTransparentBackColor, True)
  4626.         DoubleBuffered = True
  4627.         Size = New Size(24, 50)
  4628.     End Sub
  4629.  
  4630.     Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
  4631.         Dim g = e.Graphics
  4632.         With G
  4633.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  4634.             .SmoothingMode = SmoothingMode.HighQuality
  4635.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  4636.             .Clear(_BaseColour)
  4637.             Dim P() As Point = {New Point(CInt(Width / 2), 5), New Point(CInt(Width / 4), 13), New Point(CInt(Width / 2 - 2), 13), New Point(CInt(Width / 2 - 2), Height - 13), _
  4638.                                 New Point(CInt(Width / 4), Height - 13), New Point(CInt(Width / 2), Height - 5), New Point(CInt(Width - Width / 4 - 1), Height - 13), New Point(CInt(Width / 2 + 2), Height - 13), _
  4639.                                 New Point(CInt(Width / 2 + 2), 13), New Point(CInt(Width - Width / 4 - 1), 13)}
  4640.             .FillPolygon(New SolidBrush(_ArrowColour), P)
  4641.             .FillRectangle(New SolidBrush(_ThumbColour), Thumb)
  4642.             .DrawRectangle(New Pen(_ThumbBorder), Thumb)
  4643.             .DrawRectangle(New Pen(_ThumbSecondBorder), Thumb.X + 1, Thumb.Y + 1, Thumb.Width - 2, Thumb.Height - 2)
  4644.             .DrawLine(New Pen(_LineColour, 2), New Point(CInt(Thumb.Width / 2 + 1), Thumb.Y + 4), New Point(CInt(Thumb.Width / 2 + 1), Thumb.Bottom - 4))
  4645.             .DrawRectangle(New Pen(_FirstBorder), 0, 0, Width - 1, Height - 1)
  4646.             .DrawRectangle(New Pen(_SecondBorder), 1, 1, Width - 3, Height - 3)
  4647.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  4648.         End With
  4649.  
  4650.     End Sub
  4651.  
  4652. #End Region
  4653.  
  4654. End Class
  4655.  
  4656. <DefaultEvent("Scroll")> _
  4657. Public Class LogInHorizontalScrollBar
  4658.     Inherits Control
  4659.  
  4660. #Region "Declarations"
  4661.  
  4662.     Private ThumbMovement As Integer
  4663.     Private LSA As Rectangle
  4664.     Private RSA As Rectangle
  4665.     Private Shaft As Rectangle
  4666.     Private Thumb As Rectangle
  4667.     Private ShowThumb As Boolean
  4668.     Private ThumbPressed As Boolean
  4669.     Private _ThumbSize As Integer = 24
  4670.     Private _Minimum As Integer = 0
  4671.     Private _Maximum As Integer = 100
  4672.     Private _Value As Integer = 0
  4673.     Private _SmallChange As Integer = 1
  4674.     Private _ButtonSize As Integer = 16
  4675.     Private _LargeChange As Integer = 10
  4676.     Private _ThumbBorder As Color = Color.FromArgb(35, 35, 35)
  4677.     Private _LineColour As Color = Color.FromArgb(23, 119, 151)
  4678.     Private _ArrowColour As Color = Color.FromArgb(37, 37, 37)
  4679.     Private _BaseColour As Color = Color.FromArgb(47, 47, 47)
  4680.     Private _ThumbColour As Color = Color.FromArgb(55, 55, 55)
  4681.     Private _ThumbSecondBorder As Color = Color.FromArgb(65, 65, 65)
  4682.     Private _FirstBorder As Color = Color.FromArgb(55, 55, 55)
  4683.     Private _SecondBorder As Color = Color.FromArgb(35, 35, 35)
  4684.     Private ThumbDown As Boolean = False
  4685.  
  4686. #End Region
  4687.  
  4688. #Region "Properties & Events"
  4689.  
  4690.     <Category("Colours")> _
  4691.     Public Property ThumbBorder As Color
  4692.         Get
  4693.             Return _ThumbBorder
  4694.         End Get
  4695.         Set(value As Color)
  4696.             _ThumbBorder = value
  4697.         End Set
  4698.     End Property
  4699.  
  4700.     <Category("Colours")> _
  4701.     Public Property LineColour As Color
  4702.         Get
  4703.             Return _LineColour
  4704.         End Get
  4705.         Set(value As Color)
  4706.             _LineColour = value
  4707.         End Set
  4708.     End Property
  4709.  
  4710.     <Category("Colours")> _
  4711.     Public Property ArrowColour As Color
  4712.         Get
  4713.             Return _ArrowColour
  4714.         End Get
  4715.         Set(value As Color)
  4716.             _ArrowColour = value
  4717.         End Set
  4718.     End Property
  4719.  
  4720.     <Category("Colours")> _
  4721.     Public Property BaseColour As Color
  4722.         Get
  4723.             Return _BaseColour
  4724.         End Get
  4725.         Set(value As Color)
  4726.             _BaseColour = value
  4727.         End Set
  4728.     End Property
  4729.  
  4730.     <Category("Colours")> _
  4731.     Public Property ThumbColour As Color
  4732.         Get
  4733.             Return _ThumbColour
  4734.         End Get
  4735.         Set(value As Color)
  4736.             _ThumbColour = value
  4737.         End Set
  4738.     End Property
  4739.  
  4740.     <Category("Colours")> _
  4741.     Public Property ThumbSecondBorder As Color
  4742.         Get
  4743.             Return _ThumbSecondBorder
  4744.         End Get
  4745.         Set(value As Color)
  4746.             _ThumbSecondBorder = value
  4747.         End Set
  4748.     End Property
  4749.  
  4750.     <Category("Colours")> _
  4751.     Public Property FirstBorder As Color
  4752.         Get
  4753.             Return _FirstBorder
  4754.         End Get
  4755.         Set(value As Color)
  4756.             _FirstBorder = value
  4757.         End Set
  4758.     End Property
  4759.  
  4760.     <Category("Colours")> _
  4761.     Public Property SecondBorder As Color
  4762.         Get
  4763.             Return _SecondBorder
  4764.         End Get
  4765.         Set(value As Color)
  4766.             _SecondBorder = value
  4767.         End Set
  4768.     End Property
  4769.  
  4770.     Event Scroll(ByVal sender As Object)
  4771.  
  4772.     Property Minimum() As Integer
  4773.         Get
  4774.             Return _Minimum
  4775.         End Get
  4776.         Set(ByVal value As Integer)
  4777.             _Minimum = value
  4778.             If value > _Value Then _Value = value
  4779.             If value > _Maximum Then _Maximum = value
  4780.             InvalidateLayout()
  4781.         End Set
  4782.     End Property
  4783.  
  4784.     Property Maximum() As Integer
  4785.         Get
  4786.             Return _Maximum
  4787.         End Get
  4788.         Set(ByVal value As Integer)
  4789.             If value < _Value Then _Value = value
  4790.             If value < _Minimum Then _Minimum = value
  4791.         End Set
  4792.     End Property
  4793.  
  4794.     Property Value() As Integer
  4795.         Get
  4796.             Return _Value
  4797.         End Get
  4798.         Set(ByVal value As Integer)
  4799.             Select Case value
  4800.                 Case Is = _Value
  4801.                     Exit Property
  4802.                 Case Is < _Minimum
  4803.                     _Value = _Minimum
  4804.                 Case Is > _Maximum
  4805.                     _Value = _Maximum
  4806.                 Case Else
  4807.                     _Value = value
  4808.             End Select
  4809.             InvalidatePosition()
  4810.             RaiseEvent Scroll(Me)
  4811.         End Set
  4812.     End Property
  4813.  
  4814.     Public Property SmallChange() As Integer
  4815.         Get
  4816.             Return _SmallChange
  4817.         End Get
  4818.         Set(ByVal value As Integer)
  4819.             Select Case value
  4820.                 Case Is < 1
  4821.                 Case Is >
  4822.                     CInt(_SmallChange = value)
  4823.             End Select
  4824.         End Set
  4825.     End Property
  4826.  
  4827.     Public Property LargeChange() As Integer
  4828.         Get
  4829.             Return _LargeChange
  4830.         End Get
  4831.         Set(ByVal value As Integer)
  4832.             Select Case value
  4833.                 Case Is < 1
  4834.                 Case Else
  4835.                     _LargeChange = value
  4836.             End Select
  4837.         End Set
  4838.     End Property
  4839.  
  4840.     Public Property ButtonSize As Integer
  4841.         Get
  4842.             Return _ButtonSize
  4843.         End Get
  4844.         Set(value As Integer)
  4845.             Select Case value
  4846.                 Case Is < 16
  4847.                     _ButtonSize = 16
  4848.                 Case Else
  4849.                     _ButtonSize = value
  4850.             End Select
  4851.         End Set
  4852.     End Property
  4853.  
  4854.     Protected Overrides Sub OnSizeChanged(e As EventArgs)
  4855.         InvalidateLayout()
  4856.     End Sub
  4857.  
  4858.     Private Sub InvalidateLayout()
  4859.         LSA = New Rectangle(0, 1, 0, Height)
  4860.         Shaft = New Rectangle(LSA.Right + 1, 0, Width - 3, Height)
  4861.         ShowThumb = CBool(((_Maximum - _Minimum)))
  4862.         Thumb = New Rectangle(0, 1, _ThumbSize, Height - 3)
  4863.         RaiseEvent Scroll(Me)
  4864.         InvalidatePosition()
  4865.     End Sub
  4866.  
  4867.     Private Sub InvalidatePosition()
  4868.         Thumb.X = CInt(((_Value - _Minimum) / (_Maximum - _Minimum)) * (Shaft.Width - _ThumbSize) + 1)
  4869.         Invalidate()
  4870.     End Sub
  4871.  
  4872.     Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  4873.         If e.Button = Windows.Forms.MouseButtons.Left AndAlso ShowThumb Then
  4874.             If LSA.Contains(e.Location) Then
  4875.                 ThumbMovement = _Value - _SmallChange
  4876.             ElseIf RSA.Contains(e.Location) Then
  4877.                 ThumbMovement = _Value + _SmallChange
  4878.             Else
  4879.                 If Thumb.Contains(e.Location) Then
  4880.                     ThumbDown = True
  4881.                     Return
  4882.                 Else
  4883.                     If e.X < Thumb.X Then
  4884.                         ThumbMovement = _Value - _LargeChange
  4885.                     Else
  4886.                         ThumbMovement = _Value + _LargeChange
  4887.                     End If
  4888.                 End If
  4889.             End If
  4890.             Value = Math.Min(Math.Max(ThumbMovement, _Minimum), _Maximum)
  4891.             InvalidatePosition()
  4892.         End If
  4893.     End Sub
  4894.  
  4895.     Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
  4896.         If ThumbDown AndAlso ShowThumb Then
  4897.             Dim ThumbPosition As Integer = e.X - LSA.Width - (_ThumbSize \ 2)
  4898.             Dim ThumbBounds As Integer = Shaft.Width - _ThumbSize
  4899.  
  4900.             ThumbMovement = CInt((ThumbPosition / ThumbBounds) * (_Maximum - _Minimum)) + _Minimum
  4901.  
  4902.             Value = Math.Min(Math.Max(ThumbMovement, _Minimum), _Maximum)
  4903.             InvalidatePosition()
  4904.         End If
  4905.     End Sub
  4906.  
  4907.     Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs)
  4908.         ThumbDown = False
  4909.     End Sub
  4910.  
  4911. #End Region
  4912.  
  4913. #Region "Draw Control"
  4914.  
  4915.     Sub New()
  4916.         SetStyle(ControlStyles.OptimizedDoubleBuffer Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
  4917.                            ControlStyles.UserPaint Or ControlStyles.Selectable Or _
  4918.                            ControlStyles.SupportsTransparentBackColor, True)
  4919.         DoubleBuffered = True
  4920.         Height = 18
  4921.     End Sub
  4922.  
  4923.     Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
  4924.         Dim g = e.Graphics
  4925.         With G
  4926.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  4927.             .SmoothingMode = SmoothingMode.HighQuality
  4928.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  4929.             .Clear(Color.FromArgb(47, 47, 47))
  4930.             Dim P() As Point = {New Point(5, CInt(Height / 2)), New Point(13, CInt(Height / 4)), New Point(13, CInt(Height / 2 - 2)), New Point(Width - 13, CInt(Height / 2 - 2)), _
  4931.                     New Point(Width - 13, CInt(Height / 4)), New Point(Width - 5, CInt(Height / 2)), New Point(Width - 13, CInt(Height - Height / 4 - 1)), New Point(Width - 13, CInt(Height / 2 + 2)), _
  4932.                                New Point(13, CInt(Height / 2 + 2)), New Point(13, CInt(Height - Height / 4 - 1))}
  4933.             .FillPolygon(New SolidBrush(_ArrowColour), P)
  4934.             .FillRectangle(New SolidBrush(_ThumbColour), Thumb)
  4935.             .DrawRectangle(New Pen(_ThumbBorder), Thumb)
  4936.             .DrawRectangle(New Pen(_ThumbSecondBorder), Thumb.X + 1, Thumb.Y + 1, Thumb.Width - 2, Thumb.Height - 2)
  4937.             .DrawLine(New Pen((_LineColour), 2), New Point(Thumb.X + 4, (CInt(Thumb.Height / 2 + 1))), New Point(Thumb.Right - 4, (CInt(Thumb.Height / 2 + 1))))
  4938.             .DrawRectangle(New Pen(_FirstBorder), 0, 0, Width - 1, Height - 1)
  4939.             .DrawRectangle(New Pen(_SecondBorder), 1, 1, Width - 3, Height - 3)
  4940.             .InterpolationMode = InterpolationMode.HighQualityBicubic
  4941.         End With
  4942.     End Sub
  4943.  
  4944. #End Region
  4945.  
  4946. End Class
  4947.  
  4948. Public Class LogInTitledListBoxWBuiltInScrollBar
  4949.     Inherits Control
  4950.  
  4951. #Region "Declarations"
  4952.  
  4953.     Private _Items As New List(Of LogInListBoxItem)
  4954.     Private ReadOnly _SelectedItems As New List(Of LogInListBoxItem)
  4955.     Private _MultiSelect As Boolean = True
  4956.     Private ItemHeight As Integer = 24
  4957.     Private ReadOnly VerticalScrollbar As LogInVerticalScrollBar
  4958.     Private _BaseColour As Color = Color.FromArgb(55, 55, 55)
  4959.     Private _SelectedItemColour As Color = Color.FromArgb(50, 50, 50)
  4960.     Private _NonSelectedItemColour As Color = Color.FromArgb(47, 47, 47)
  4961.     Private _TitleAreaColour As Color = Color.FromArgb(42, 42, 42)
  4962.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  4963.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  4964.     Private _SelectedHeight As Integer = 1
  4965.  
  4966. #End Region
  4967.  
  4968. #Region "Properties"
  4969.  
  4970.     <Category("Colours")> _
  4971.     Public Property TitleAreaColour As Color
  4972.         Get
  4973.             Return _TitleAreaColour
  4974.         End Get
  4975.         Set(value As Color)
  4976.             _TitleAreaColour = value
  4977.         End Set
  4978.     End Property
  4979.  
  4980.     <Category("Colours")> _
  4981.     Public Property TextColour As Color
  4982.         Get
  4983.             Return _TextColour
  4984.         End Get
  4985.         Set(value As Color)
  4986.             _TextColour = value
  4987.         End Set
  4988.     End Property
  4989.  
  4990.     <Category("Control")> _
  4991.     Public Property SelectedHeight As Integer
  4992.         Get
  4993.             Return _SelectedHeight
  4994.         End Get
  4995.         Set(value As Integer)
  4996.             If value < 1 Then
  4997.                 _SelectedHeight = Height
  4998.             Else
  4999.                 _SelectedHeight = value
  5000.             End If
  5001.             InvalidateScroll()
  5002.         End Set
  5003.     End Property
  5004.  
  5005.     <Category("Colours")> _
  5006.     Public Property BaseColour As Color
  5007.         Get
  5008.             Return _BaseColour
  5009.         End Get
  5010.         Set(value As Color)
  5011.             _BaseColour = value
  5012.         End Set
  5013.     End Property
  5014.  
  5015.     <Category("Colours")> _
  5016.     Public Property SelectedItemColour As Color
  5017.         Get
  5018.             Return _SelectedItemColour
  5019.         End Get
  5020.         Set(value As Color)
  5021.             _SelectedItemColour = value
  5022.         End Set
  5023.     End Property
  5024.  
  5025.     <Category("Colours")> _
  5026.     Public Property NonSelectedItemColour As Color
  5027.         Get
  5028.             Return _NonSelectedItemColour
  5029.         End Get
  5030.         Set(value As Color)
  5031.             _NonSelectedItemColour = value
  5032.         End Set
  5033.     End Property
  5034.  
  5035.     <Category("Colours")> _
  5036.     Public Property BorderColour As Color
  5037.         Get
  5038.             Return _BorderColour
  5039.         End Get
  5040.         Set(value As Color)
  5041.             _BorderColour = value
  5042.         End Set
  5043.     End Property
  5044.  
  5045.  
  5046.     Private Sub HandleScroll(ByVal sender As Object)
  5047.         Invalidate()
  5048.     End Sub
  5049.  
  5050.     Private Sub InvalidateScroll()
  5051.         Debug.Print(CStr(Height))
  5052.         If CInt(Math.Round(((_Items.Count) * ItemHeight) / _SelectedHeight)) < CDbl((((_Items.Count) * ItemHeight) / _SelectedHeight)) Then
  5053.             VerticalScrollbar._Maximum = CInt(Math.Ceiling(((_Items.Count) * ItemHeight) / _SelectedHeight))
  5054.         ElseIf CInt(Math.Round(((_Items.Count) * ItemHeight) / _SelectedHeight)) = 0 Then
  5055.             VerticalScrollbar._Maximum = 1
  5056.         Else
  5057.             VerticalScrollbar._Maximum = CInt(Math.Round(((_Items.Count) * ItemHeight) / _SelectedHeight))
  5058.         End If
  5059.         Invalidate()
  5060.     End Sub
  5061.  
  5062.     Private Sub InvalidateLayout()
  5063.         VerticalScrollbar.Location = New Point(Width - VerticalScrollbar.Width - 2, 2)
  5064.         VerticalScrollbar.Size = New Size(18, Height - 4)
  5065.         Invalidate()
  5066.     End Sub
  5067.  
  5068.     Public Class LogInListBoxItem
  5069.         Property Text As String
  5070.         Public Overrides Function ToString() As String
  5071.             Return Text
  5072.         End Function
  5073.     End Class
  5074.  
  5075.     <System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)> _
  5076.     Public Property Items() As LogInListBoxItem()
  5077.         Get
  5078.             Return _Items.ToArray()
  5079.         End Get
  5080.         Set(ByVal value As LogInListBoxItem())
  5081.             _Items = New List(Of LogInListBoxItem)(value)
  5082.             Invalidate()
  5083.             InvalidateScroll()
  5084.         End Set
  5085.     End Property
  5086.  
  5087.     Public ReadOnly Property SelectedItems() As LogInListBoxItem()
  5088.         Get
  5089.             Return _SelectedItems.ToArray()
  5090.         End Get
  5091.     End Property
  5092.  
  5093.     Public Property MultiSelect() As Boolean
  5094.         Get
  5095.             Return _MultiSelect
  5096.         End Get
  5097.         Set(ByVal value As Boolean)
  5098.             _MultiSelect = value
  5099.  
  5100.             If _SelectedItems.Count > 1 Then
  5101.                 _SelectedItems.RemoveRange(1, _SelectedItems.Count - 1)
  5102.             End If
  5103.  
  5104.             Invalidate()
  5105.         End Set
  5106.     End Property
  5107.  
  5108.     Public Overrides Property Font As Font
  5109.         Get
  5110.             Return MyBase.Font
  5111.         End Get
  5112.         Set(ByVal value As Font)
  5113.             ItemHeight = CInt(Graphics.FromHwnd(Handle).MeasureString("@", Font).Height)
  5114.             If VerticalScrollbar IsNot Nothing Then
  5115.                 VerticalScrollbar._SmallChange = 1
  5116.                 VerticalScrollbar._LargeChange = 1
  5117.  
  5118.             End If
  5119.             MyBase.Font = value
  5120.             InvalidateLayout()
  5121.         End Set
  5122.     End Property
  5123.  
  5124.     Public Sub AddItem(ByVal Items As String)
  5125.         Dim Item As New LogInListBoxItem()
  5126.         Item.Text = Items
  5127.         _Items.Add(Item)
  5128.         Invalidate()
  5129.         InvalidateScroll()
  5130.     End Sub
  5131.  
  5132.     Public Sub AddItems(ByVal Items() As String)
  5133.         For Each I In Items
  5134.             Dim Item As New LogInListBoxItem()
  5135.             Item.Text = I
  5136.             _Items.Add(Item)
  5137.         Next
  5138.         Invalidate()
  5139.         InvalidateScroll()
  5140.     End Sub
  5141.  
  5142.     Public Sub RemoveItemAt(ByVal index As Integer)
  5143.         _Items.RemoveAt(index)
  5144.         Invalidate()
  5145.         InvalidateScroll()
  5146.     End Sub
  5147.  
  5148.     Public Sub RemoveItem(ByVal item As LogInListBoxItem)
  5149.         _Items.Remove(item)
  5150.         Invalidate()
  5151.         InvalidateScroll()
  5152.     End Sub
  5153.  
  5154.     Public Sub RemoveItems(ByVal items As LogInListBoxItem())
  5155.         For Each I As LogInListBoxItem In items
  5156.             _Items.Remove(I)
  5157.         Next
  5158.         Invalidate()
  5159.         InvalidateScroll()
  5160.     End Sub
  5161.  
  5162.     Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  5163.         _SelectedHeight = Height
  5164.         InvalidateScroll()
  5165.         InvalidateLayout()
  5166.         MyBase.OnSizeChanged(e)
  5167.     End Sub
  5168.  
  5169.     Private Sub Vertical_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
  5170.         Focus()
  5171.     End Sub
  5172.  
  5173.     Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  5174.         Focus()
  5175.         If e.Button = MouseButtons.Left Then
  5176.             Dim Offset As Integer = CInt(VerticalScrollbar.Value * (VerticalScrollbar.Maximum + (Height - (ItemHeight))))
  5177.  
  5178.             Dim Index As Integer = ((e.Y + Offset) \ ItemHeight)
  5179.  
  5180.             If Index > _Items.Count - 1 Then Index = -1
  5181.  
  5182.             If Not Index = -1 Then
  5183.  
  5184.                 If ModifierKeys = Keys.Control AndAlso _MultiSelect Then
  5185.                     If _SelectedItems.Contains(_Items(Index)) Then
  5186.                         _SelectedItems.Remove(_Items(Index))
  5187.                     Else
  5188.                         _SelectedItems.Add(_Items(Index))
  5189.                     End If
  5190.                 Else
  5191.                     _SelectedItems.Clear()
  5192.                     _SelectedItems.Add(_Items(Index))
  5193.                 End If
  5194.                 Debug.Print(CStr(_SelectedItems(0).Text))
  5195.             End If
  5196.  
  5197.             Invalidate()
  5198.         End If
  5199.         MyBase.OnMouseDown(e)
  5200.     End Sub
  5201.  
  5202.     Protected Overrides Sub OnMouseWheel(ByVal e As MouseEventArgs)
  5203.         Dim Move As Integer = -((e.Delta * SystemInformation.MouseWheelScrollLines \ 120) * (2 \ 2))
  5204.         Dim Value As Integer = Math.Max(Math.Min(VerticalScrollbar.Value + Move, VerticalScrollbar.Maximum), VerticalScrollbar.Minimum)
  5205.         VerticalScrollbar.Value = Value
  5206.         MyBase.OnMouseWheel(e)
  5207.     End Sub
  5208.  
  5209. #End Region
  5210.  
  5211. #Region "Draw Control"
  5212.  
  5213.     Sub New()
  5214.         SetStyle(ControlStyles.OptimizedDoubleBuffer Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
  5215.                     ControlStyles.UserPaint Or ControlStyles.Selectable Or _
  5216.                     ControlStyles.SupportsTransparentBackColor, True)
  5217.         DoubleBuffered = True
  5218.         VerticalScrollbar = New LogInVerticalScrollBar
  5219.         VerticalScrollbar.SmallChange = 1
  5220.         VerticalScrollbar.LargeChange = 1
  5221.         AddHandler VerticalScrollbar.Scroll, AddressOf HandleScroll
  5222.         AddHandler VerticalScrollbar.MouseDown, AddressOf Vertical_MouseDown
  5223.         Controls.Add(VerticalScrollbar)
  5224.         InvalidateLayout()
  5225.     End Sub
  5226.  
  5227.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  5228.         Dim G = e.Graphics
  5229.         With G
  5230.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  5231.             .SmoothingMode = SmoothingMode.HighQuality
  5232.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  5233.             .Clear(_BaseColour)
  5234.             Dim AllItems As LogInListBoxItem
  5235.             Dim Offset As Integer = CInt(VerticalScrollbar.Value * (VerticalScrollbar.Maximum + (Height - (ItemHeight))))
  5236.             Dim StartIndex As Integer
  5237.             If Offset = 0 Then StartIndex = 0 Else StartIndex = CInt(Offset \ ItemHeight \ VerticalScrollbar.Maximum)
  5238.             Dim EndIndex As Integer = Math.Min(StartIndex + (Height \ ItemHeight), _Items.Count - 1)
  5239.  
  5240.             For I As Integer = StartIndex To _Items.Count - 1
  5241.                 AllItems = Items(I)
  5242.                 Dim Y As Integer = (ItemHeight + (I * ItemHeight) + 1 - Offset) + CInt((ItemHeight / 2) - 8)
  5243.                 If _SelectedItems.Contains(AllItems) Then
  5244.                     .FillRectangle(New SolidBrush(_SelectedItemColour), New Rectangle(0, ItemHeight + (I * ItemHeight) + 1 - Offset, Width - 19, ItemHeight - 1))
  5245.                 Else
  5246.                     .FillRectangle(New SolidBrush(_NonSelectedItemColour), New Rectangle(0, ItemHeight + (I * ItemHeight) + 1 - Offset, Width - 19, ItemHeight - 1))
  5247.                 End If
  5248.                 .DrawLine(New Pen(_BorderColour), 0, (ItemHeight + (I * ItemHeight) + 1 - Offset) + ItemHeight - 1, Width - 18, (ItemHeight + (I * ItemHeight) + 1 - Offset) + ItemHeight - 1)
  5249.                 .DrawString(AllItems.Text, New Font("Segoe UI", 8), New SolidBrush(_TextColour), 9, Y)
  5250.                 .ResetClip()
  5251.             Next
  5252.             .FillRectangle(New SolidBrush(_TitleAreaColour), New Rectangle(0, 0, Width, ItemHeight))
  5253.             .DrawRectangle(New Pen(Color.FromArgb(35, 35, 35)), 1, 1, Width - 3, ItemHeight - 2)
  5254.             .DrawString(Text, New Font("Segoe UI", 10, FontStyle.Bold), New SolidBrush(_TextColour), New Rectangle(0, 0, Width, ItemHeight + 2), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  5255.             .DrawRectangle(New Pen(Color.FromArgb(35, 35, 35), 2), 1, 0, Width - 2, Height - 1)
  5256.             .DrawLine(New Pen(_BorderColour), 0, ItemHeight, Width, ItemHeight)
  5257.             .DrawLine(New Pen(_BorderColour, 2), VerticalScrollbar.Location.X - 1, 0, VerticalScrollbar.Location.X - 1, Height)
  5258.             .InterpolationMode = CType(7, InterpolationMode)
  5259.         End With
  5260.     End Sub
  5261.  
  5262. #End Region
  5263.  
  5264. End Class
  5265.  
  5266. Public Class LogInListBoxWBuiltInScrollBar
  5267.     Inherits Control
  5268.  
  5269. #Region "Declarations"
  5270.  
  5271.     Private _Items As New List(Of LogInListBoxItem)
  5272.     Private ReadOnly _SelectedItems As New List(Of LogInListBoxItem)
  5273.     Private _MultiSelect As Boolean = True
  5274.     Private ItemHeight As Integer = 24
  5275.     Private ReadOnly VerticalScrollbar As LogInVerticalScrollBar
  5276.     Private _BaseColour As Color = Color.FromArgb(55, 55, 55)
  5277.     Private _SelectedItemColour As Color = Color.FromArgb(50, 50, 50)
  5278.     Private _NonSelectedItemColour As Color = Color.FromArgb(47, 47, 47)
  5279.     Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
  5280.     Private _TextColour As Color = Color.FromArgb(255, 255, 255)
  5281.     Private _SelectedHeight As Integer = 1
  5282.  
  5283. #End Region
  5284.  
  5285. #Region "Properties"
  5286.  
  5287.     <Category("Colours")> _
  5288.     Public Property TextColour As Color
  5289.         Get
  5290.             Return _TextColour
  5291.         End Get
  5292.         Set(value As Color)
  5293.             _TextColour = value
  5294.         End Set
  5295.     End Property
  5296.  
  5297.     <Category("Control")> _
  5298.     Public Property SelectedHeight As Integer
  5299.         Get
  5300.             Return _SelectedHeight
  5301.         End Get
  5302.         Set(value As Integer)
  5303.             If value < 1 Then
  5304.                 _SelectedHeight = Height
  5305.             Else
  5306.                 _SelectedHeight = value
  5307.             End If
  5308.             InvalidateScroll()
  5309.         End Set
  5310.     End Property
  5311.  
  5312.     <Category("Colours")> _
  5313.     Public Property BaseColour As Color
  5314.         Get
  5315.             Return _BaseColour
  5316.         End Get
  5317.         Set(value As Color)
  5318.             _BaseColour = value
  5319.         End Set
  5320.     End Property
  5321.  
  5322.     <Category("Colours")> _
  5323.     Public Property SelectedItemColour As Color
  5324.         Get
  5325.             Return _SelectedItemColour
  5326.         End Get
  5327.         Set(value As Color)
  5328.             _SelectedItemColour = value
  5329.         End Set
  5330.     End Property
  5331.  
  5332.     <Category("Colours")> _
  5333.     Public Property NonSelectedItemColour As Color
  5334.         Get
  5335.             Return _NonSelectedItemColour
  5336.         End Get
  5337.         Set(value As Color)
  5338.             _NonSelectedItemColour = value
  5339.         End Set
  5340.     End Property
  5341.  
  5342.     <Category("Colours")> _
  5343.     Public Property BorderColour As Color
  5344.         Get
  5345.             Return _BorderColour
  5346.         End Get
  5347.         Set(value As Color)
  5348.             _BorderColour = value
  5349.         End Set
  5350.     End Property
  5351.  
  5352.  
  5353.     Private Sub HandleScroll(ByVal sender As Object)
  5354.         Invalidate()
  5355.     End Sub
  5356.  
  5357.     Private Sub InvalidateScroll()
  5358.         Debug.Print(CStr(Height))
  5359.         If CInt(Math.Round(((_Items.Count) * ItemHeight) / _SelectedHeight)) < CDbl((((_Items.Count) * ItemHeight) / _SelectedHeight)) Then
  5360.             VerticalScrollbar._Maximum = CInt(Math.Ceiling(((_Items.Count) * ItemHeight) / _SelectedHeight))
  5361.         ElseIf CInt(Math.Round(((_Items.Count) * ItemHeight) / _SelectedHeight)) = 0 Then
  5362.             VerticalScrollbar._Maximum = 1
  5363.         Else
  5364.             VerticalScrollbar._Maximum = CInt(Math.Round(((_Items.Count) * ItemHeight) / _SelectedHeight))
  5365.         End If
  5366.         Invalidate()
  5367.     End Sub
  5368.  
  5369.     Private Sub InvalidateLayout()
  5370.         VerticalScrollbar.Location = New Point(Width - VerticalScrollbar.Width - 2, 2)
  5371.         VerticalScrollbar.Size = New Size(18, Height - 4)
  5372.         Invalidate()
  5373.     End Sub
  5374.  
  5375.     Public Class LogInListBoxItem
  5376.         Property Text As String
  5377.         Public Overrides Function ToString() As String
  5378.             Return Text
  5379.         End Function
  5380.     End Class
  5381.  
  5382.     <System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)> _
  5383.     Public Property Items() As LogInListBoxItem()
  5384.         Get
  5385.             Return _Items.ToArray()
  5386.         End Get
  5387.         Set(ByVal value As LogInListBoxItem())
  5388.             _Items = New List(Of LogInListBoxItem)(value)
  5389.             Invalidate()
  5390.             InvalidateScroll()
  5391.         End Set
  5392.     End Property
  5393.  
  5394.     Public ReadOnly Property SelectedItems() As LogInListBoxItem()
  5395.         Get
  5396.             Return _SelectedItems.ToArray()
  5397.         End Get
  5398.     End Property
  5399.  
  5400.     Public Property MultiSelect() As Boolean
  5401.         Get
  5402.             Return _MultiSelect
  5403.         End Get
  5404.         Set(ByVal value As Boolean)
  5405.             _MultiSelect = value
  5406.  
  5407.             If _SelectedItems.Count > 1 Then
  5408.                 _SelectedItems.RemoveRange(1, _SelectedItems.Count - 1)
  5409.             End If
  5410.  
  5411.             Invalidate()
  5412.         End Set
  5413.     End Property
  5414.  
  5415.     Public Overrides Property Font As Font
  5416.         Get
  5417.             Return MyBase.Font
  5418.         End Get
  5419.         Set(ByVal value As Font)
  5420.             ItemHeight = CInt(Graphics.FromHwnd(Handle).MeasureString("@", Font).Height)
  5421.             If VerticalScrollbar IsNot Nothing Then
  5422.                 VerticalScrollbar._SmallChange = 1
  5423.                 VerticalScrollbar._LargeChange = 1
  5424.  
  5425.             End If
  5426.             MyBase.Font = value
  5427.             InvalidateLayout()
  5428.         End Set
  5429.     End Property
  5430.  
  5431.     Public Sub AddItem(ByVal Items As String)
  5432.         Dim Item As New LogInListBoxItem()
  5433.         Item.Text = Items
  5434.         _Items.Add(Item)
  5435.         Invalidate()
  5436.         InvalidateScroll()
  5437.     End Sub
  5438.  
  5439.     Public Sub AddItems(ByVal Items() As String)
  5440.         For Each I In Items
  5441.             Dim Item As New LogInListBoxItem()
  5442.             Item.Text = I
  5443.             _Items.Add(Item)
  5444.         Next
  5445.         Invalidate()
  5446.         InvalidateScroll()
  5447.     End Sub
  5448.  
  5449.     Public Sub RemoveItemAt(ByVal index As Integer)
  5450.         _Items.RemoveAt(index)
  5451.         Invalidate()
  5452.         InvalidateScroll()
  5453.     End Sub
  5454.  
  5455.     Public Sub RemoveItem(ByVal item As LogInListBoxItem)
  5456.         _Items.Remove(item)
  5457.         Invalidate()
  5458.         InvalidateScroll()
  5459.     End Sub
  5460.  
  5461.     Public Sub RemoveItems(ByVal items As LogInListBoxItem())
  5462.         For Each I As LogInListBoxItem In items
  5463.             _Items.Remove(I)
  5464.         Next
  5465.         Invalidate()
  5466.         InvalidateScroll()
  5467.     End Sub
  5468.  
  5469.     Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  5470.         _SelectedHeight = Height
  5471.         InvalidateScroll()
  5472.         InvalidateLayout()
  5473.         MyBase.OnSizeChanged(e)
  5474.     End Sub
  5475.  
  5476.     Private Sub Vertical_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
  5477.         Focus()
  5478.     End Sub
  5479.  
  5480.     Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  5481.         Focus()
  5482.         If e.Button = MouseButtons.Left Then
  5483.             Dim Offset As Integer = CInt(VerticalScrollbar.Value * (VerticalScrollbar.Maximum + (Height - (ItemHeight))))
  5484.  
  5485.             Dim Index As Integer = ((e.Y + Offset) \ ItemHeight)
  5486.  
  5487.             If Index > _Items.Count - 1 Then Index = -1
  5488.  
  5489.             If Not Index = -1 Then
  5490.  
  5491.                 If ModifierKeys = Keys.Control AndAlso _MultiSelect Then
  5492.                     If _SelectedItems.Contains(_Items(Index)) Then
  5493.                         _SelectedItems.Remove(_Items(Index))
  5494.                     Else
  5495.                         _SelectedItems.Add(_Items(Index))
  5496.                     End If
  5497.                 Else
  5498.                     _SelectedItems.Clear()
  5499.                     _SelectedItems.Add(_Items(Index))
  5500.                 End If
  5501.                 Debug.Print(CStr(_SelectedItems(0).Text))
  5502.             End If
  5503.  
  5504.             Invalidate()
  5505.         End If
  5506.         MyBase.OnMouseDown(e)
  5507.     End Sub
  5508.  
  5509.     Protected Overrides Sub OnMouseWheel(ByVal e As MouseEventArgs)
  5510.         Dim Move As Integer = -((e.Delta * SystemInformation.MouseWheelScrollLines \ 120) * (2 \ 2))
  5511.         Dim Value As Integer = Math.Max(Math.Min(VerticalScrollbar.Value + Move, VerticalScrollbar.Maximum), VerticalScrollbar.Minimum)
  5512.         VerticalScrollbar.Value = Value
  5513.         MyBase.OnMouseWheel(e)
  5514.     End Sub
  5515.  
  5516. #End Region
  5517.  
  5518. #Region "Draw Control"
  5519.  
  5520.     Sub New()
  5521.         SetStyle(ControlStyles.OptimizedDoubleBuffer Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
  5522.                     ControlStyles.UserPaint Or ControlStyles.Selectable Or _
  5523.                     ControlStyles.SupportsTransparentBackColor, True)
  5524.         DoubleBuffered = True
  5525.         VerticalScrollbar = New LogInVerticalScrollBar
  5526.         VerticalScrollbar._SmallChange = 1
  5527.         VerticalScrollbar._LargeChange = 1
  5528.         AddHandler VerticalScrollbar.Scroll, AddressOf HandleScroll
  5529.         AddHandler VerticalScrollbar.MouseDown, AddressOf Vertical_MouseDown
  5530.         Controls.Add(VerticalScrollbar)
  5531.         InvalidateLayout()
  5532.     End Sub
  5533.  
  5534.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  5535.         Dim g = e.Graphics
  5536.         With G
  5537.             .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  5538.             .SmoothingMode = SmoothingMode.HighQuality
  5539.             .PixelOffsetMode = PixelOffsetMode.HighQuality
  5540.             .Clear(_BaseColour)
  5541.             Dim AllItems As LogInListBoxItem
  5542.             Dim Offset As Integer = CInt(VerticalScrollbar.Value * (VerticalScrollbar.Maximum + (Height - (ItemHeight))))
  5543.             Dim StartIndex As Integer
  5544.             If Offset = 0 Then StartIndex = 0 Else StartIndex = CInt(Offset \ ItemHeight \ VerticalScrollbar.Maximum)
  5545.             Dim EndIndex As Integer = Math.Min(StartIndex + (Height \ ItemHeight), _Items.Count - 1)
  5546.             .DrawLine(New Pen(_BorderColour, 2), VerticalScrollbar.Location.X - 1, 0, VerticalScrollbar.Location.X - 1, Height)
  5547.  
  5548.             For I As Integer = StartIndex To _Items.Count - 1
  5549.                 AllItems = Items(I)
  5550.                 Dim Y As Integer = ((I * ItemHeight) + 1 - Offset) + CInt((ItemHeight / 2) - 8)
  5551.                 If _SelectedItems.Contains(AllItems) Then
  5552.                     .FillRectangle(New SolidBrush(_SelectedItemColour), New Rectangle(0, (I * ItemHeight) + 1 - Offset, Width - 19, ItemHeight - 1))
  5553.                 Else
  5554.                     .FillRectangle(New SolidBrush(_NonSelectedItemColour), New Rectangle(0, (I * ItemHeight) + 1 - Offset, Width - 19, ItemHeight - 1))
  5555.                 End If
  5556.                 .DrawLine(New Pen(_BorderColour), 0, ((I * ItemHeight) + 1 - Offset) + ItemHeight - 1, Width - 18, ((I * ItemHeight) + 1 - Offset) + ItemHeight - 1)
  5557.                 .DrawString(AllItems.Text, New Font("Segoe UI", 8), New SolidBrush(_TextColour), 9, Y)
  5558.                 .ResetClip()
  5559.             Next
  5560.             .DrawRectangle(New Pen(Color.FromArgb(35, 35, 35), 2), 1, 1, Width - 2, Height - 2)
  5561.             '   .DrawLine(New Pen(_BorderColour), 0, ItemHeight, Width, ItemHeight)
  5562.             .DrawLine(New Pen(_BorderColour, 2), VerticalScrollbar.Location.X - 1, 0, VerticalScrollbar.Location.X - 1, Height)
  5563.             .InterpolationMode = CType(7, InterpolationMode)
  5564.         End With
  5565.  
  5566.     End Sub
  5567.  
  5568. #End Region
  5569.  
  5570. End Class
  5571.  
  5572. <DefaultEvent("SelectedIndexChanged")> _
  5573. Public Class LogInPaginator
  5574.     Inherits Control
  5575.  
  5576. #Region "Declarations"
  5577.     Private GP1, GP2 As GraphicsPath
  5578.  
  5579.     Private R1 As Rectangle
  5580.  
  5581.     Private SZ1 As Size
  5582.     Private PT1 As Point
  5583.  
  5584.     Private P1, P2, P3 As Pen
  5585.     Private B1, B2 As SolidBrush
  5586. #End Region
  5587.  
  5588. #Region "Functions"
  5589.     Public Function RoundRectangle(ByVal Rectangle As Rectangle, ByVal Curve As Integer) As GraphicsPath
  5590.         Dim P As GraphicsPath = New GraphicsPath()
  5591.         Dim ArcRectangleWidth As Integer = Curve * 2
  5592.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  5593.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  5594.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  5595.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  5596.         P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
  5597.         Return P
  5598.     End Function
  5599.  
  5600.     Public Function RoundRect(x!, y!, w!, h!, Optional r! = 0.3, Optional TL As Boolean = True, Optional TR As Boolean = True, Optional BR As Boolean = True, Optional BL As Boolean = True) As GraphicsPath
  5601.         Dim d! = Math.Min(w, h) * r, xw = x + w, yh = y + h
  5602.         RoundRect = New GraphicsPath
  5603.         With RoundRect
  5604.             If TL Then .AddArc(x, y, d, d, 180, 90) Else .AddLine(x, y, x, y)
  5605.             If TR Then .AddArc(xw - d, y, d, d, 270, 90) Else .AddLine(xw, y, xw, y)
  5606.             If BR Then .AddArc(xw - d, yh - d, d, d, 0, 90) Else .AddLine(xw, yh, xw, yh)
  5607.             If BL Then .AddArc(x, yh - d, d, d, 90, 90) Else .AddLine(x, yh, x, yh)
  5608.             .CloseFigure()
  5609.         End With
  5610.     End Function
  5611. #End Region
  5612.  
  5613. #Region "Properties & Events"
  5614.     Public Event SelectedIndexChanged(sender As Object, e As EventArgs)
  5615.  
  5616.     Private _SelectedIndex As Integer
  5617.     Public Property SelectedIndex() As Integer
  5618.         Get
  5619.             Return _SelectedIndex
  5620.         End Get
  5621.         Set(ByVal value As Integer)
  5622.             _SelectedIndex = Math.Max(Math.Min(value, MaximumIndex), 0)
  5623.             Invalidate()
  5624.         End Set
  5625.     End Property
  5626.  
  5627.     Private _NumberOfPages As Integer
  5628.     Public Property NumberOfPages() As Integer
  5629.         Get
  5630.             Return _NumberOfPages
  5631.         End Get
  5632.         Set(ByVal value As Integer)
  5633.             _NumberOfPages = value
  5634.             _SelectedIndex = Math.Max(Math.Min(_SelectedIndex, MaximumIndex), 0)
  5635.             Invalidate()
  5636.         End Set
  5637.     End Property
  5638.  
  5639.     Public ReadOnly Property MaximumIndex As Integer
  5640.         Get
  5641.             Return NumberOfPages - 1
  5642.         End Get
  5643.     End Property
  5644.  
  5645.     Private ItemWidth As Integer
  5646.     Public Overrides Property Font As Font
  5647.         Get
  5648.             Return MyBase.Font
  5649.         End Get
  5650.         Set(value As Font)
  5651.             MyBase.Font = value
  5652.             Invalidate()
  5653.         End Set
  5654.     End Property
  5655.  
  5656.     Private Sub InvalidateItems(ByVal e As PaintEventArgs)
  5657.         Dim S As Size = e.Graphics.MeasureString("000 ..", Font).ToSize()
  5658.         ItemWidth = S.Width + 10
  5659.     End Sub
  5660.  
  5661.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  5662.         If e.Button = Windows.Forms.MouseButtons.Left Then
  5663.             Dim NewIndex As Integer
  5664.             Dim OldIndex As Integer = _SelectedIndex
  5665.             If _SelectedIndex < 4 Then
  5666.                 NewIndex = (e.X \ ItemWidth)
  5667.             ElseIf _SelectedIndex > 3 AndAlso _SelectedIndex < (MaximumIndex - 3) Then
  5668.                 NewIndex = (e.X \ ItemWidth)
  5669.                 Select Case NewIndex
  5670.                     Case 2
  5671.                         NewIndex = OldIndex
  5672.                     Case Is < 2
  5673.                         NewIndex = OldIndex - (2 - NewIndex)
  5674.                     Case Is > 2
  5675.                         NewIndex = OldIndex + (NewIndex - 2)
  5676.                 End Select
  5677.             Else
  5678.                 NewIndex = MaximumIndex - (4 - (e.X \ ItemWidth))
  5679.             End If
  5680.             If (NewIndex < _NumberOfPages) AndAlso (Not NewIndex = OldIndex) Then
  5681.                 SelectedIndex = NewIndex
  5682.                 RaiseEvent SelectedIndexChanged(Me, Nothing)
  5683.             End If
  5684.         End If
  5685.         MyBase.OnMouseDown(e)
  5686.     End Sub
  5687.  
  5688. #End Region
  5689.  
  5690. #Region "Draw Control"
  5691.  
  5692.     Sub New()
  5693.         SetStyle(ControlStyles.OptimizedDoubleBuffer Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
  5694.                   ControlStyles.UserPaint Or ControlStyles.Selectable Or _
  5695.                   ControlStyles.SupportsTransparentBackColor, True)
  5696.         DoubleBuffered = True
  5697.         BackColor = Color.FromArgb(54, 54, 54)
  5698.         Size = New Size(202, 26)
  5699.         B1 = New SolidBrush(Color.FromArgb(50, 50, 50))
  5700.         B2 = New SolidBrush(Color.FromArgb(55, 55, 55))
  5701.         P1 = New Pen(Color.FromArgb(35, 35, 35))
  5702.         P2 = New Pen(Color.FromArgb(23, 119, 151))
  5703.         P3 = New Pen(Color.FromArgb(35, 35, 35))
  5704.     End Sub
  5705.  
  5706.     Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
  5707.         InvalidateItems(e)
  5708.         Dim g = e.Graphics
  5709.         With g
  5710.             .Clear(BackColor)
  5711.             .SmoothingMode = SmoothingMode.AntiAlias
  5712.             .TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit
  5713.             Dim LeftEllipse, RightEllipse As Boolean
  5714.             If _SelectedIndex < 4 Then
  5715.                 For I As Integer = 0 To Math.Min(MaximumIndex, 4)
  5716.                     RightEllipse = (I = 4) AndAlso (MaximumIndex > 4)
  5717.                     DrawBox(I * ItemWidth, I, False, RightEllipse, g)
  5718.                 Next
  5719.             ElseIf _SelectedIndex > 3 AndAlso _SelectedIndex < (MaximumIndex - 3) Then
  5720.                 For I As Integer = 0 To 4
  5721.                     LeftEllipse = (I = 0)
  5722.                     RightEllipse = (I = 4)
  5723.                     DrawBox(I * ItemWidth, _SelectedIndex + I - 2, LeftEllipse, RightEllipse, g)
  5724.                 Next
  5725.             Else
  5726.                 For I As Integer = 0 To 4
  5727.                     LeftEllipse = (I = 0) AndAlso (MaximumIndex > 4)
  5728.                     DrawBox(I * ItemWidth, MaximumIndex - (4 - I), LeftEllipse, False, g)
  5729.                 Next
  5730.             End If
  5731.         End With
  5732.     End Sub
  5733.  
  5734.     Private Sub DrawBox(ByVal x As Integer, ByVal index As Integer, ByVal leftEllipse As Boolean, ByVal rightEllipse As Boolean, ByVal g As Graphics)
  5735.         R1 = New Rectangle(x, 0, ItemWidth - 4, Height - 1)
  5736.         GP1 = RoundRectangle(R1, 4)
  5737.         GP2 = RoundRectangle(New Rectangle(R1.X + 1, R1.Y + 1, R1.Width - 2, R1.Height - 2), 4)
  5738.         Dim T As String = CStr(index + 1)
  5739.         If leftEllipse Then T = ".. " & T
  5740.         If rightEllipse Then T = T & " .."
  5741.         SZ1 = g.MeasureString(T, Font).ToSize()
  5742.         PT1 = New Point(R1.X + (R1.Width \ 2 - SZ1.Width \ 2), R1.Y + (R1.Height \ 2 - SZ1.Height \ 2))
  5743.         If index = _SelectedIndex Then
  5744.             g.FillPath(B1, GP1)
  5745.             Dim F As New Font(Font, FontStyle.Underline)
  5746.             g.DrawString(T, F, Brushes.Black, PT1.X + 1, PT1.Y + 1)
  5747.             g.DrawString(T, F, Brushes.White, PT1)
  5748.             F.Dispose()
  5749.             g.DrawPath(P1, GP2)
  5750.             g.DrawPath(P2, GP1)
  5751.         Else
  5752.             g.FillPath(B2, GP1)
  5753.             g.DrawString(T, Font, Brushes.Black, PT1.X + 1, PT1.Y + 1)
  5754.             g.DrawString(T, Font, Brushes.White, PT1)
  5755.             g.DrawPath(P3, GP2)
  5756.             g.DrawPath(P1, GP1)
  5757.         End If
  5758.     End Sub
  5759.  
  5760. #End Region
  5761.  
  5762. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement