Advertisement
Finessed

Loyal Theme

Dec 2nd, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 41.34 KB | None | 0 0
  1. Imports System.Drawing
  2. Imports System.Drawing.Drawing2D
  3. Imports System.ComponentModel
  4. Imports System.Text
  5. Imports System.Drawing.Text
  6.  
  7. ''' <summary>
  8. ''' Get more free themes at ThemesVB.NET
  9. ''' Loyal Theme
  10. ''' Created by Earn
  11. ''' From HackForums.net
  12. ''' </summary>
  13. ''' <remarks></remarks>
  14.  
  15. Enum MouseState
  16.     None = 0
  17.     Over = 1
  18.     Down = 2
  19. End Enum
  20.  
  21. Class LoyalTheme
  22.     Inherits ContainerControl
  23.  
  24. #Region " Back End "
  25.  
  26. #Region " Enums "
  27.  
  28.     Enum ControlsAlign
  29.         Left = 0
  30.         Right = 2
  31.     End Enum
  32.  
  33.     Enum TextAlign
  34.         Left = 0
  35.         Center = 1
  36.         Right = 2
  37.     End Enum
  38.  
  39. #End Region
  40.  
  41. #Region " Declarations "
  42.     Private _Down As Boolean = False
  43.     Private _Header As Integer = 47
  44.     Private _MousePoint As Point
  45.     Private _ControlsFormat As New StringFormat With {.LineAlignment = StringAlignment.Center}
  46. #End Region
  47.  
  48. #Region " Properties "
  49.  
  50.     Private _HeaderColor As Color = Color.Aqua
  51.     <Category("Header Settings")>
  52.     Public Property HeaderColor() As Color
  53.         Get
  54.             Return _HeaderColor
  55.         End Get
  56.         Set(ByVal value As Color)
  57.             _HeaderColor = value
  58.             Invalidate()
  59.         End Set
  60.     End Property
  61. ' Get more free themes at ThemesVB.NET
  62.     'Alignments
  63.     Private _ControlsAlignment As ControlsAlign = ControlsAlign.Right
  64.     <Category("Header Settings")>
  65.     Public Property ControlsAlignment() As ControlsAlign
  66.         Get
  67.             Return _ControlsAlignment
  68.         End Get
  69.         Set(ByVal value As ControlsAlign)
  70.             _ControlsAlignment = value
  71.             Invalidate()
  72.         End Set
  73.     End Property
  74.  
  75.     Private _TextAlignment As TextAlign = TextAlign.Center
  76.     <Category("Header Settings")>
  77.     Public Property TextAlignment() As TextAlign
  78.         Get
  79.             Return _TextAlignment
  80.         End Get
  81.         Set(ByVal value As TextAlign)
  82.             _TextAlignment = value
  83.             Invalidate()
  84.         End Set
  85.     End Property
  86.  
  87.     'Header Size
  88.     Private _HeaderSize As Integer = 30
  89.     <Category("Header Settings")>
  90.     Public Property HeaderSize() As Integer
  91.         Get
  92.             Return _HeaderSize
  93.         End Get
  94.         Set(ByVal value As Integer)
  95.             _HeaderSize = value
  96.             Invalidate()
  97.         End Set
  98.     End Property
  99.  
  100.  
  101.     'Show Controls
  102.     Private _ShowClose As Boolean
  103.     <Category("Header Settings")>
  104.     Public Property ShowClose() As Boolean
  105.         Get
  106.             Return _ShowClose
  107.         End Get
  108.         Set(ByVal value As Boolean)
  109.             _ShowClose = value
  110.             Invalidate()
  111.         End Set
  112.     End Property
  113.  
  114.     Private _ShowMinimize As Boolean
  115.     <Category("Header Settings")>
  116.     Public Property ShowMinimize() As Boolean
  117.         Get
  118.             Return _ShowMinimize
  119.         End Get
  120.         Set(ByVal value As Boolean)
  121.             _ShowMinimize = value
  122.             Invalidate()
  123.         End Set
  124.     End Property
  125.  
  126.     Private _ShowMaximize As Boolean
  127.     <Category("Header Settings")>
  128.     Public Property ShowMaximize() As Boolean
  129.         Get
  130.             Return _ShowMaximize
  131.         End Get
  132.         Set(ByVal value As Boolean)
  133.             _ShowMaximize = value
  134.             Invalidate()
  135.         End Set
  136.     End Property
  137.  
  138. #End Region
  139.  
  140. #Region " Mouse States "
  141.  
  142.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  143.         MyBase.OnMouseDown(e)
  144.  
  145.         Select Case ControlsAlignment
  146.             Case ControlsAlign.Right
  147.                 '_ShowClose
  148.                 If _ShowClose = True Then
  149.                     If New Rectangle(Width - 23, (((_HeaderSize + 2) - 18) / 2), 18, 18).Contains(e.Location) Then
  150.                         Application.Exit()
  151.                     End If
  152.                 End If
  153.  
  154.                 '_ShowMinimize
  155.                 If _ShowMinimize = True Then
  156.                     If _ShowMaximize = True Then
  157.                         If _ShowClose = True Then
  158.  
  159.                             If New Rectangle(Width - 58, (((_HeaderSize + 2) - 18) / 2), 17, 18).Contains(e.Location) Then
  160.                                 FindForm.WindowState = FormWindowState.Minimized
  161.                                 Exit Sub
  162.                             End If
  163.  
  164.                         Else
  165.                             If New Rectangle(Width - 41, (((_HeaderSize + 2) - 18) / 2), 18, 18).Contains(e.Location) Then
  166.                                 FindForm.WindowState = FormWindowState.Minimized
  167.                                 Exit Sub
  168.                             End If
  169.                         End If
  170.                     Else
  171.                         If _ShowClose = True Then
  172.                             If New Rectangle(Width - 41, (((_HeaderSize + 2) - 18) / 2), 18, 18).Contains(e.Location) Then
  173.                                 FindForm.WindowState = FormWindowState.Minimized
  174.                                 Exit Sub
  175.                             End If
  176.                         Else
  177.                             If New Rectangle(Width - 23, (((_HeaderSize + 2) - 18) / 2), 18, 18).Contains(e.Location) Then
  178.                                 FindForm.WindowState = FormWindowState.Minimized
  179.                                 Exit Sub
  180.                             End If
  181.                         End If
  182.                     End If
  183.                 End If
  184. ' Get more free themes at ThemesVB.NET
  185.                 '_ShowMaximize
  186.                 If _ShowMaximize = True Then
  187.                     If _ShowClose = True Then
  188.  
  189.                         If New Rectangle(Width - 41, (((_HeaderSize + 2) - 18) / 2), 18, 18).Contains(e.Location) Then
  190.                             If FindForm.WindowState = FormWindowState.Maximized Then
  191.                                 FindForm.WindowState = FormWindowState.Normal
  192.                                 Refresh()
  193.                             ElseIf FindForm.WindowState = FormWindowState.Normal Then
  194.                                 FindForm.WindowState = FormWindowState.Maximized
  195.                                 Refresh()
  196.                             End If
  197.                             Exit Sub
  198.                         End If
  199.  
  200.                     Else
  201.                         If New Rectangle(Width - 23, (((_HeaderSize + 2) - 18) / 2), 18, 18).Contains(e.Location) Then
  202.                             If FindForm.WindowState = FormWindowState.Maximized Then
  203.                                 FindForm.WindowState = FormWindowState.Normal
  204.                                 Refresh()
  205.                             ElseIf FindForm.WindowState = FormWindowState.Normal Then
  206.                                 FindForm.WindowState = FormWindowState.Maximized
  207.                                 Refresh()
  208.                             End If
  209.                             Exit Sub
  210.                         End If
  211.                     End If
  212.                 End If
  213.  
  214.             Case ControlsAlign.Left
  215.                 '_ShowClose
  216.                 If _ShowClose = True Then
  217.                     If New Rectangle(4, (((_HeaderSize + 2) - 18) / 2), 18, 18).Contains(e.Location) Then
  218.                         Application.Exit()
  219.                     End If
  220.                 End If
  221.  
  222.                 '_ShowMinimize
  223.                 If _ShowMinimize = True Then
  224.                     If _ShowMaximize = True Then
  225.                         If _ShowClose = True Then
  226.  
  227.                             If New Rectangle(40, (((_HeaderSize + 2) - 18) / 2), 17, 18).Contains(e.Location) Then
  228.                                 FindForm.WindowState = FormWindowState.Minimized
  229.                                 Exit Sub
  230.                             End If
  231.  
  232.                         Else
  233.                             If New Rectangle(22, (((_HeaderSize + 2) - 18) / 2), 18, 18).Contains(e.Location) Then
  234.                                 FindForm.WindowState = FormWindowState.Minimized
  235.                                 Exit Sub
  236.                             End If
  237.                         End If
  238.                     Else
  239.                         If _ShowClose = True Then
  240.                             If New Rectangle(22, (((_HeaderSize + 2) - 18) / 2), 18, 18).Contains(e.Location) Then
  241.                                 FindForm.WindowState = FormWindowState.Minimized
  242.                                 Exit Sub
  243.                             End If
  244.                         Else
  245.                             If New Rectangle(4, (((_HeaderSize + 2) - 18) / 2), 18, 18).Contains(e.Location) Then
  246.                                 FindForm.WindowState = FormWindowState.Minimized
  247.                                 Exit Sub
  248.                             End If
  249.                         End If
  250.                     End If
  251.                 End If
  252.  
  253.                 '_ShowMaximize
  254.                 If _ShowMaximize = True Then
  255.                     If _ShowClose = True Then
  256.  
  257.                         If New Rectangle(22, (((_HeaderSize + 2) - 18) / 2), 18, 18).Contains(e.Location) Then
  258.                             If FindForm.WindowState = FormWindowState.Maximized Then
  259.                                 FindForm.WindowState = FormWindowState.Normal
  260.                                 Refresh()
  261.                             ElseIf FindForm.WindowState = FormWindowState.Normal Then
  262.                                 FindForm.WindowState = FormWindowState.Maximized
  263.                                 Refresh()
  264.                             End If
  265.                             Exit Sub
  266.                         End If
  267.  
  268.                     Else
  269.                         If New Rectangle(4, (((_HeaderSize + 2) - 18) / 2), 18, 18).Contains(e.Location) Then
  270.                             If FindForm.WindowState = FormWindowState.Maximized Then
  271.                                 FindForm.WindowState = FormWindowState.Normal
  272.                                 Refresh()
  273.                             ElseIf FindForm.WindowState = FormWindowState.Normal Then
  274.                                 FindForm.WindowState = FormWindowState.Maximized
  275.                                 Refresh()
  276.                             End If
  277.                             Exit Sub
  278.                         End If
  279.                     End If
  280.                 End If
  281.         End Select
  282.  
  283.         If e.Y < _Header AndAlso e.Button = Windows.Forms.MouseButtons.Left Then
  284.             _Down = True
  285.             _MousePoint = New Point(e.Location)
  286.         End If
  287.     End Sub
  288.  
  289.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  290.         MyBase.OnMouseUp(e)
  291.         _Down = False
  292.     End Sub
  293.  
  294.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  295.         MyBase.OnMouseMove(e)
  296.         If _Down = True Then
  297.             ParentForm.Location = MousePosition - _MousePoint
  298.         End If
  299.     End Sub
  300.  
  301. #End Region
  302. ' Get more free themes at ThemesVB.NET
  303. #Region " Misc "
  304.     Protected Overrides Sub OnCreateControl()
  305.         MyBase.OnCreateControl()
  306.         Dock = DockStyle.Fill
  307.         ParentForm.TransparencyKey = Color.Fuchsia
  308.         ParentForm.FormBorderStyle = FormBorderStyle.None
  309.         BackColor = Color.FromArgb(31, 31, 31)
  310.         Invalidate()
  311.     End Sub
  312.  
  313. #End Region
  314.  
  315. #End Region
  316.  
  317.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  318.         MyBase.OnPaint(e)
  319.         Dim G = e.Graphics
  320.         With G
  321.             Dim _StringF As New StringFormat With {.LineAlignment = StringAlignment.Center}
  322.             .Clear(Color.FromArgb(31, 31, 31))
  323.             .FillRectangle(New SolidBrush(_HeaderColor), New Rectangle(0, 0, Width, 5))
  324.             .FillRectangle(New SolidBrush(Color.FromArgb(34, 34, 34)), New Rectangle(0, 5, Width, _HeaderSize))
  325.             .DrawLine(New Pen(Color.FromArgb(38, 38, 38)), New Point(0, _HeaderSize + 5), New Point(Width, _HeaderSize + 5))
  326.             .DrawLine(New Pen(Color.FromArgb(24, 24, 24)), New Point(0, _HeaderSize + 6), New Point(Width, _HeaderSize + 6))
  327.             .DrawLine(Pens.Fuchsia, New Point(0, 0), New Point(0, 2))
  328.             .DrawLine(Pens.Fuchsia, New Point(0, 0), New Point(2, 0))
  329.             .DrawLine(Pens.Fuchsia, New Point(Width - 1, 0), New Point(Width - 1, 2))
  330.             .DrawLine(Pens.Fuchsia, New Point(Width - 1, 0), New Point(Width - 3, 0))
  331.             If _ControlsAlignment = ControlsAlign.Right Then
  332.                 If _ShowClose = True Then
  333.                     .DrawString("r", New Font("Marlett", 11), Brushes.White, New RectangleF(Width - 23, 5, 23, _HeaderSize + 3), _ControlsFormat)
  334.                 End If
  335.                 If _ShowMinimize = True Then
  336.                     If _ShowMaximize = True Then
  337.                         If _ShowClose = True Then
  338.                             G.DrawString("0", New Font("Marlett", 11), Brushes.White, New RectangleF(Width - 57, 5, 23, _HeaderSize + 3), _ControlsFormat)
  339.                         Else
  340.                             G.DrawString("0", New Font("Marlett", 11), Brushes.White, New RectangleF(Width - 41, 5, 23, _HeaderSize + 3), _ControlsFormat)
  341.                         End If
  342.                     Else
  343.                         If _ShowClose = True Then
  344.                             G.DrawString("0", New Font("Marlett", 11), Brushes.White, New RectangleF(Width - 41, 5, 23, _HeaderSize + 3), _ControlsFormat)
  345.                         Else
  346.                             G.DrawString("0", New Font("Marlett", 11), Brushes.White, New RectangleF(Width - 23, 5, 23, _HeaderSize + 3), _ControlsFormat)
  347.                         End If
  348.                     End If
  349.                 End If
  350.                 If _ShowMaximize = True Then
  351.                     If _ShowClose = True Then
  352.                         If FindForm.WindowState = FormWindowState.Maximized Then
  353.                             .DrawString("1", New Font("Marlett", 11), Brushes.White, New RectangleF(Width - 41, 5, 23, _HeaderSize + 3), _ControlsFormat)
  354.                         ElseIf FindForm.WindowState = FormWindowState.Normal Then
  355.                             .DrawString("2", New Font("Marlett", 11), Brushes.White, New RectangleF(Width - 41, 5, 23, _HeaderSize + 3), _ControlsFormat)
  356.                         End If
  357.                     Else
  358.                         If FindForm.WindowState = FormWindowState.Maximized Then
  359.                             .DrawString("1", New Font("Marlett", 11), Brushes.White, New RectangleF(Width - 23, 5, 23, _HeaderSize + 3), _ControlsFormat)
  360.                         ElseIf FindForm.WindowState = FormWindowState.Normal Then
  361.                             .DrawString("2", New Font("Marlett", 11), Brushes.White, New RectangleF(Width - 23, 5, 23, _HeaderSize + 3), _ControlsFormat)
  362.                         End If
  363.                     End If
  364.                 End If
  365.             End If
  366.             If _ControlsAlignment = ControlsAlign.Left Then
  367.                 If _ShowClose = True Then
  368.                     .DrawString("r", New Font("Marlett", 11), Brushes.White, New RectangleF(5, 5, 23, _HeaderSize + 3), _ControlsFormat)
  369.                 End If
  370.                 If _ShowMinimize = True Then
  371.                     If _ShowMaximize = True Then
  372.                         If _ShowClose = True Then
  373.                             G.DrawString("0", New Font("Marlett", 11), Brushes.White, New RectangleF(41, 5, 23, _HeaderSize + 3), _ControlsFormat)
  374.                         Else
  375.                             G.DrawString("0", New Font("Marlett", 11), Brushes.White, New RectangleF(23, 5, 23, _HeaderSize + 3), _ControlsFormat)
  376.                         End If
  377.                     Else
  378.                         If _ShowClose = True Then
  379.                             G.DrawString("0", New Font("Marlett", 11), Brushes.White, New RectangleF(23, 5, 23, _HeaderSize + 3), _ControlsFormat)
  380.                         Else
  381.                             G.DrawString("0", New Font("Marlett", 11), Brushes.White, New RectangleF(5, 5, 23, _HeaderSize + 3), _ControlsFormat)
  382.                         End If
  383.                     End If
  384.                 End If
  385.                 If _ShowMaximize = True Then
  386.                     If _ShowClose = True Then
  387.                         If FindForm.WindowState = FormWindowState.Maximized Then
  388.                             .DrawString("1", New Font("Marlett", 11), Brushes.White, New RectangleF(23, 5, 23, _HeaderSize + 3), _ControlsFormat)
  389.                         ElseIf FindForm.WindowState = FormWindowState.Normal Then
  390.                             .DrawString("2", New Font("Marlett", 11), Brushes.White, New RectangleF(23, 5, 23, _HeaderSize + 3), _ControlsFormat)
  391.                         End If
  392.                     Else
  393.                         If FindForm.WindowState = FormWindowState.Maximized Then
  394.                             .DrawString("1", New Font("Marlett", 11), Brushes.White, New RectangleF(5, 5, 23, _HeaderSize + 3), _ControlsFormat)
  395.                         ElseIf FindForm.WindowState = FormWindowState.Normal Then
  396.                             .DrawString("2", New Font("Marlett", 11), Brushes.White, New RectangleF(5, 5, 23, _HeaderSize + 3), _ControlsFormat)
  397.                         End If
  398.                     End If
  399.                 End If
  400.             End If
  401.             Select Case _TextAlignment
  402.                 Case TextAlign.Center
  403.                     _StringF.Alignment = StringAlignment.Center
  404.                     .DrawString(Text, New Font("Arial", 9), Brushes.White, New RectangleF(0, 5, Width, _HeaderSize), _StringF)
  405.  
  406.                 Case TextAlign.Left
  407.                     .DrawString(Text, New Font("Arial", 9), Brushes.White, New RectangleF(10, 5, Width, _HeaderSize), _StringF)
  408.  
  409.                 Case TextAlign.Right
  410.                     Dim _TextLength As Integer = TextRenderer.MeasureText(Text, New Font("Arial", 9)).Width + 10
  411.                     .DrawString(Text, New Font("Arial", 9), Brushes.White, New RectangleF(Width - _TextLength, 5, Width, _HeaderSize), _StringF)
  412.             End Select
  413.         End With
  414.     End Sub
  415. End Class
  416.  
  417. Class LoyalButton
  418.     Inherits Control
  419.  
  420. #Region " Back End "
  421.  
  422. #Region " Enums "
  423.     Enum Alignment
  424.         Left = 0
  425.         Center = 1
  426.         Right = 2
  427.     End Enum
  428. #End Region
  429.  
  430. #Region " Declarations "
  431.     Private _State As MouseState = MouseState.None
  432. #End Region
  433.  
  434. #Region " Mouse States "
  435.  
  436.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  437.         MyBase.OnMouseEnter(e)
  438.         _State = MouseState.Over
  439.         Invalidate()
  440.     End Sub
  441.  
  442.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  443.         MyBase.OnMouseLeave(e)
  444.         _State = MouseState.None
  445.         Invalidate()
  446.     End Sub
  447.  
  448.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  449.         MyBase.OnMouseDown(e)
  450.         _State = MouseState.Down
  451.         Invalidate()
  452.     End Sub
  453.  
  454.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  455.         MyBase.OnMouseUp(e)
  456.         _State = MouseState.Over
  457.         Invalidate()
  458.     End Sub
  459.  
  460. #End Region
  461.  
  462. #Region " Properties "
  463.  
  464.     Private _TextAlignment As Alignment = Alignment.Center
  465.     <Category("Button Settings")>
  466.     Public Property TextAlignment() As Alignment
  467.         Get
  468.             Return _TextAlignment
  469.         End Get
  470.         Set(ByVal value As Alignment)
  471.             _TextAlignment = value
  472.             Invalidate()
  473.         End Set
  474.     End Property
  475.  
  476.     Private _OutlineColor As Color = Color.FromArgb(102, 51, 153)
  477.     <Category("Button Settings")>
  478.     Public Property OutlineColor() As Color
  479.         Get
  480.             Return _OutlineColor
  481.         End Get
  482.         Set(ByVal value As Color)
  483.             _OutlineColor = value
  484.             Invalidate()
  485.         End Set
  486.     End Property
  487.  
  488. #End Region
  489.  
  490.     Sub New()
  491.         Size = New Size(75, 25)
  492.     End Sub
  493. #End Region
  494. ' Get more free themes at ThemesVB.NET
  495.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  496.         MyBase.OnPaint(e)
  497.         Dim G = e.Graphics
  498.         With G
  499.             .Clear(Color.FromArgb(40, 40, 40))
  500.             Select Case _State
  501.                 Case MouseState.None
  502.                     .DrawRectangle(New Pen(Color.FromArgb(24, 24, 24)), New Rectangle(0, 0, Width - 1, Height - 1))
  503.                 Case MouseState.Over
  504.                     .DrawRectangle(New Pen(_OutlineColor), New Rectangle(0, 0, Width - 1, Height - 1))
  505.  
  506.                 Case MouseState.Down
  507.                     .FillRectangle(New SolidBrush(Color.FromArgb(30, 30, 30)), New Rectangle(0, 0, Width - 1, Height - 1))
  508.                     .DrawRectangle(New Pen(_OutlineColor), New Rectangle(0, 0, Width - 1, Height - 1))
  509.             End Select
  510.             .DrawRectangle(New Pen(Color.FromArgb(48, 48, 48)), New Rectangle(1, 1, Width - 3, Height - 3))
  511.             .FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(0, 0, 1, 1))
  512.             .FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(0, Height - 1, 1, 1))
  513.             .FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(Width - 1, 0, 1, 1))
  514.             .FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(Width - 1, Height - 1, 1, 1))
  515.             Dim _StringF As New StringFormat With {.LineAlignment = StringAlignment.Center}
  516.             Select Case _TextAlignment
  517.                 Case Alignment.Center
  518.                     _StringF.Alignment = StringAlignment.Center
  519.                     .DrawString(Text, New Font("Arial", 9), Brushes.White, New RectangleF(0, 0, Width - 1, Height - 1), _StringF)
  520.                 Case Alignment.Left
  521.                     .DrawString(Text, New Font("Arial", 9), Brushes.White, New RectangleF(7, 0, Width - 11, Height - 1), _StringF)
  522.                 Case Alignment.Right
  523.                     Dim _StringLength As Integer = TextRenderer.MeasureText(Text, New Font("Arial", 9)).Width + 8
  524.                     .DrawString(Text, New Font("Arial", 9), Brushes.White, New Rectangle(Width - _StringLength, 0, Width - _StringLength, Height - 1), _StringF)
  525.             End Select
  526.         End With
  527.     End Sub
  528. End Class
  529.  
  530. Class LoyalGroupBox
  531.     Inherits ContainerControl
  532.  
  533. #Region " Back End "
  534.  
  535. #Region " Enums "
  536.  
  537.     Enum TextAlign
  538.         Left = 0
  539.         Center = 1
  540.         Right = 2
  541.     End Enum
  542.  
  543. #End Region
  544.  
  545. #Region " Properties "
  546.  
  547.     Private _HeaderSize As Integer = 35
  548.     <Category("Header Properties")>
  549.     Public Property HeaderSize() As Integer
  550.         Get
  551.             Return _HeaderSize
  552.         End Get
  553.         Set(ByVal value As Integer)
  554.             _HeaderSize = value
  555.             Invalidate()
  556.         End Set
  557.     End Property
  558.  
  559.     Private _HeaderColor As Color = Color.FromArgb(102, 51, 153)
  560.     <Category("Header Properties")>
  561.     Public Property HeaderColor() As Color
  562.         Get
  563.             Return _HeaderColor
  564.         End Get
  565.         Set(ByVal value As Color)
  566.             _HeaderColor = value
  567.             Invalidate()
  568.         End Set
  569.     End Property
  570.  
  571.     Private _TextAlignment As TextAlign = TextAlign.Left
  572.     Public Property TextAlignment() As TextAlign
  573.         Get
  574.             Return _TextAlignment
  575.         End Get
  576.         Set(ByVal value As TextAlign)
  577.             _TextAlignment = value
  578.         End Set
  579.     End Property
  580.  
  581. #End Region
  582.  
  583.     Protected Overrides Sub OnCreateControl()
  584.         MyBase.OnCreateControl()
  585.         BackColor = Color.FromArgb(40, 40, 40)
  586.     End Sub
  587.  
  588.     Sub New()
  589.         Size = New Size(200, 100)
  590.     End Sub
  591.  
  592. #End Region
  593.  
  594.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  595.         MyBase.OnPaint(e)
  596.         Dim G = e.Graphics
  597.         With G
  598.             .Clear(Color.FromArgb(40, 40, 40))
  599.             .FillRectangle(New SolidBrush(_HeaderColor), New Rectangle(5, 5, Width - 10, _HeaderSize - 5))
  600.             .DrawLine(New Pen(Color.FromArgb(30, Color.White)), New Point(6, 5), New Point(Width - 6, 5))
  601.             .FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(0, 0, 1, 1))
  602.             .FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(Width - 1, 0, 1, 1))
  603.             .DrawLine(New Pen(Color.FromArgb(70, Color.Black)), New Point(5, _HeaderSize), New Point(Width - 6, _HeaderSize))
  604.             .DrawRectangle(New Pen(Color.FromArgb(18, 18, 18)), New Rectangle(0, 0, Width - 1, Height - 1))
  605.             .FillRectangle(New SolidBrush(Color.FromArgb(40, 40, 40)), New Rectangle(5, 5, 1, 1))
  606.             .FillRectangle(New SolidBrush(Color.FromArgb(40, 40, 40)), New Rectangle(Width - 6, 5, 1, 1))
  607.             .FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(0, 0, 1, 1))
  608.             .FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(0, Height - 1, 1, 1))
  609.             .FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(Width - 1, 0, 1, 1))
  610.             .FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(Width - 1, Height - 1, 1, 1))
  611.             Dim _StringF As New StringFormat With {.LineAlignment = StringAlignment.Center}
  612.             Select Case _TextAlignment
  613.                 Case TextAlign.Center
  614.                     _StringF.Alignment = StringAlignment.Center
  615.                     .DrawString(Text, New Font("Arial", 9), Brushes.White, New RectangleF(5, 5, Width - 10, _HeaderSize - 5), _StringF)
  616.                 Case TextAlign.Left
  617.                     .DrawString(Text, New Font("Arial", 9), Brushes.White, New RectangleF(12, 5, Width - 10, _HeaderSize - 5), _StringF)
  618.                 Case TextAlign.Right
  619.                     Dim _StringLength As Integer = TextRenderer.MeasureText(Text, New Font("Arial", 9)).Width + 8
  620.                     .DrawString(Text, New Font("Arial", 9), Brushes.White, New Rectangle(Width - _StringLength, 5, Width - _StringLength, _HeaderSize - 5), _StringF)
  621.             End Select
  622.         End With
  623.     End Sub
  624. End Class
  625.  
  626. <DefaultEvent("CheckedChanged")>
  627. Class LoyalRadioButton
  628.     Inherits Control
  629.  
  630. #Region " Back End "
  631.  
  632. #Region " Declarations "
  633.     Private _State As MouseState = MouseState.None
  634.     Private _Checked As Boolean
  635. #End Region
  636.  
  637. #Region " Properties "
  638.     Property Checked() As Boolean
  639.         Get
  640.             Return _Checked
  641.         End Get
  642.         Set(value As Boolean)
  643.             _Checked = value
  644.             InvalidateControls()
  645.             RaiseEvent CheckedChanged(Me)
  646.             Invalidate()
  647.         End Set
  648.     End Property
  649.     Event CheckedChanged(ByVal sender As Object)
  650.     Protected Overrides Sub OnClick(e As EventArgs)
  651.         If Not _Checked Then Checked = True
  652.         MyBase.OnClick(e)
  653.     End Sub
  654.     Private Sub InvalidateControls()
  655.         If Not IsHandleCreated OrElse Not _Checked Then Return
  656.         For Each C As Control In Parent.Controls
  657.             If C IsNot Me AndAlso TypeOf C Is LoyalRadioButton Then
  658.                 DirectCast(C, LoyalRadioButton).Checked = False
  659.                 Invalidate()
  660.             End If
  661.         Next
  662.     End Sub
  663. ' Get more free themes at ThemesVB.NET
  664.     Private _CheckedColor As Color = Color.FromArgb(102, 51, 153)
  665.     <Category("Colors Settings")>
  666.     Public Property CheckedColor() As Color
  667.         Get
  668.             Return _CheckedColor
  669.         End Get
  670.         Set(ByVal value As Color)
  671.             _CheckedColor = value
  672.             Invalidate()
  673.         End Set
  674.     End Property
  675.     Protected Overrides Sub OnCreateControl()
  676.         MyBase.OnCreateControl()
  677.         InvalidateControls()
  678.     End Sub
  679.  
  680.  
  681.     Protected Overrides Sub OnResize(e As EventArgs)
  682.         MyBase.OnResize(e)
  683.         Height = 16
  684.     End Sub
  685.  
  686. #Region " Mouse States "
  687.  
  688.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  689.         MyBase.OnMouseDown(e)
  690.         _State = MouseState.Down
  691.         Invalidate()
  692.     End Sub
  693.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  694.         MyBase.OnMouseUp(e)
  695.         _State = MouseState.Over
  696.         Invalidate()
  697.     End Sub
  698.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  699.         MyBase.OnMouseEnter(e)
  700.         _State = MouseState.Over
  701.         Invalidate()
  702.     End Sub
  703.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  704.         MyBase.OnMouseLeave(e)
  705.         _State = MouseState.None
  706.         Invalidate()
  707.     End Sub
  708.  
  709. #End Region
  710.  
  711. #End Region
  712.  
  713. #End Region
  714.  
  715.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  716.         MyBase.OnPaint(e)
  717.         Dim G = e.Graphics
  718.         G.SmoothingMode = SmoothingMode.AntiAlias
  719.         G.Clear(Parent.BackColor)
  720.         If Parent.BackColor = Color.FromArgb(40, 40, 40) Then
  721.             G.FillEllipse(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(0, 0, 13, 13))
  722.         Else
  723.             G.FillEllipse(New SolidBrush(Color.FromArgb(40, 40, 40)), New Rectangle(0, 0, 13, 13))
  724.         End If
  725.         G.DrawEllipse(New Pen(Color.FromArgb(18, 18, 18)), New Rectangle(0, 0, 13, 13))
  726.  
  727.         If Checked Then
  728.             G.FillEllipse(New SolidBrush(_CheckedColor), New Rectangle(3, 3, 7, 7))
  729.         End If
  730.         G.DrawString(Text, New Font("Arial", 9), Brushes.White, New Point(18, 0))
  731.     End Sub
  732. End Class
  733.  
  734. <DefaultEvent("CheckedChanged")>
  735. Class LoyalCheckBox
  736.     Inherits Control
  737.  
  738. #Region " Back End "
  739.  
  740. #Region " Declarations "
  741.     Private _State As MouseState = MouseState.None
  742.     Private _Checked As Boolean
  743. #End Region
  744. ' Get more free themes at ThemesVB.NET
  745. #Region " Properties "
  746.     Property Checked() As Boolean
  747.         Get
  748.             Return _Checked
  749.         End Get
  750.         Set(value As Boolean)
  751.             _Checked = value
  752.             RaiseEvent CheckedChanged(Me)
  753.             Invalidate()
  754.         End Set
  755.     End Property
  756.     Event CheckedChanged(ByVal sender As Object)
  757.     Protected Overrides Sub OnClick(e As EventArgs)
  758.         If Not _Checked Then
  759.             Checked = True
  760.         Else
  761.             Checked = False
  762.         End If
  763.         MyBase.OnClick(e)
  764.     End Sub
  765.  
  766.     Private _CheckedColor As Color = Color.FromArgb(102, 51, 153)
  767.     <Category("Colors Settings")>
  768.     Public Property CheckedColor() As Color
  769.         Get
  770.             Return _CheckedColor
  771.         End Get
  772.         Set(ByVal value As Color)
  773.             _CheckedColor = value
  774.             Invalidate()
  775.         End Set
  776.     End Property
  777.  
  778.     Protected Overrides Sub OnResize(e As EventArgs)
  779.         MyBase.OnResize(e)
  780.         Height = 16
  781.     End Sub
  782.  
  783. #Region " Mouse States "
  784.  
  785.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  786.         MyBase.OnMouseDown(e)
  787.         _State = MouseState.Down
  788.         Invalidate()
  789.     End Sub
  790.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  791.         MyBase.OnMouseUp(e)
  792.         _State = MouseState.Over
  793.         Invalidate()
  794.     End Sub
  795.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  796.         MyBase.OnMouseEnter(e)
  797.         _State = MouseState.Over
  798.         Invalidate()
  799.     End Sub
  800.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  801.         MyBase.OnMouseLeave(e)
  802.         _State = MouseState.None
  803.         Invalidate()
  804.     End Sub
  805.  
  806. #End Region
  807.  
  808. #End Region
  809.  
  810. #End Region
  811.  
  812.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  813.         MyBase.OnPaint(e)
  814.         Dim G = e.Graphics
  815.         G.Clear(Parent.BackColor)
  816.         If Parent.BackColor = Color.FromArgb(40, 40, 40) Then
  817.             G.FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(0, 0, 13, 13))
  818.         Else
  819.             G.FillRectangle(New SolidBrush(Color.FromArgb(40, 40, 40)), New Rectangle(0, 0, 13, 13))
  820.         End If
  821.         G.DrawRectangle(New Pen(Color.FromArgb(18, 18, 18)), New Rectangle(0, 0, 13, 13))
  822.  
  823.         If Checked Then
  824.             G.FillRectangle(New SolidBrush(_CheckedColor), New Rectangle(3, 3, 8, 8))
  825.         End If
  826.         G.DrawString(Text, New Font("Arial", 9), Brushes.White, New Point(18, 0))
  827.     End Sub
  828. End Class
  829.  
  830. Class LoyalProgressBar
  831.     Inherits Control
  832.  
  833. #Region " Back End "
  834.  
  835. #Region " Variables "
  836.     Private _Value As Integer = 0
  837.     Private _Maximum As Integer = 100
  838. #End Region
  839.  
  840. #Region " Control "
  841.     <Category("Control")>
  842.     Public Property Maximum() As Integer
  843.         Get
  844.             Return _Maximum
  845.         End Get
  846.         Set(V As Integer)
  847.             Select Case V
  848.                 Case Is < _Value
  849.                     _Value = V
  850.             End Select
  851.             _Maximum = V
  852.             Invalidate()
  853.         End Set
  854.     End Property
  855.  
  856.     <Category("Control")>
  857.     Public Property Value() As Integer
  858.         Get
  859.             Select Case _Value
  860.                 Case 0
  861.                     Return 0
  862.                     Invalidate()
  863.                 Case Else
  864.                     Return _Value
  865.                     Invalidate()
  866.             End Select
  867.         End Get
  868.         Set(V As Integer)
  869.             Select Case V
  870.                 Case Is > _Maximum
  871.                     V = _Maximum
  872.                     Invalidate()
  873.             End Select
  874.             _Value = V
  875.             Invalidate()
  876.         End Set
  877.     End Property
  878. #End Region
  879.  
  880. #Region " Events "
  881.     Protected Overrides Sub OnResize(e As EventArgs)
  882.         MyBase.OnResize(e)
  883.         Height = 25
  884.     End Sub
  885.  
  886.     Protected Overrides Sub CreateHandle()
  887.         MyBase.CreateHandle()
  888.         Height = 25
  889.     End Sub
  890. ' Get more free themes at ThemesVB.NET
  891.     Public Sub Increment(ByVal Amount As Integer)
  892.         Value += Amount
  893.     End Sub
  894. #End Region
  895.  
  896. #Region " Properties "
  897.     Private _ProgressColor As Color = Color.FromArgb(102, 51, 153)
  898.     <Category("Header Properties")>
  899.     Public Property ProgressColor() As Color
  900.         Get
  901.             Return _ProgressColor
  902.         End Get
  903.         Set(ByVal value As Color)
  904.             _ProgressColor = value
  905.             Invalidate()
  906.         End Set
  907.     End Property
  908. #End Region
  909.  
  910.     Sub New()
  911.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or
  912.                  ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer, True)
  913.         DoubleBuffered = True
  914.     End Sub
  915. #End Region
  916.  
  917.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  918.         MyBase.OnPaint(e)
  919.         Dim G = e.Graphics
  920.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  921.         G.SmoothingMode = SmoothingMode.HighQuality
  922.         G.PixelOffsetMode = PixelOffsetMode.HighQuality
  923.         If Parent.BackColor = Color.FromArgb(40, 40, 40) Then
  924.             G.Clear(Color.FromArgb(35, 35, 35))
  925.         Else
  926.             G.Clear(Color.FromArgb(40, 40, 40))
  927.         End If
  928.         Dim _Progress As Integer = CInt(_Value / _Maximum * Width)
  929.         G.DrawRectangle(New Pen(Color.FromArgb(18, 18, 18)), 0, 0, Width, Height)
  930.         G.FillRectangle(New SolidBrush(_ProgressColor), New Rectangle(0, 0, _Progress - 1, Height))
  931.         G.DrawLine(New Pen(Color.FromArgb(30, Color.White)), New Point(0, 0), New Point(_Progress - 1, 0))
  932.         G.FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(0, 0, 1, 1))
  933.         G.FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(Width - 1, 0, 1, 1))
  934.         G.DrawLine(New Pen(Color.FromArgb(70, Color.Black)), New Point(0, Height), New Point(_Progress - 1, Height))
  935.         G.InterpolationMode = CType(7, InterpolationMode)
  936.     End Sub
  937. End Class
  938.  
  939. <DefaultEvent("TextChanged")>
  940. Class LoyalTextBox
  941.     Inherits Control
  942.  
  943. #Region " Back End "
  944.  
  945. #Region " Variables "
  946.     Private _State As MouseState = MouseState.None
  947.     Private WithEvents TB As System.Windows.Forms.TextBox
  948. #End Region
  949.  
  950. #Region " Properties "
  951.  
  952. #Region " TextBox Properties "
  953.  
  954.     Private _TextAlign As HorizontalAlignment = HorizontalAlignment.Left
  955.     <Category("Options")>
  956.     Property TextAlign() As HorizontalAlignment
  957.         Get
  958.             Return _TextAlign
  959.         End Get
  960.         Set(ByVal value As HorizontalAlignment)
  961.             _TextAlign = value
  962.             If TB IsNot Nothing Then
  963.                 TB.TextAlign = value
  964.             End If
  965.         End Set
  966.     End Property
  967.     Private _MaxLength As Integer = 32767
  968.     <Category("Options")>
  969.     Property MaxLength() As Integer
  970.         Get
  971.             Return _MaxLength
  972.         End Get
  973.         Set(ByVal value As Integer)
  974.             _MaxLength = value
  975.             If TB IsNot Nothing Then
  976.                 TB.MaxLength = value
  977.             End If
  978.         End Set
  979.     End Property
  980.     Private _ReadOnly As Boolean
  981.     <Category("Options")>
  982.     Property [ReadOnly]() As Boolean
  983.         Get
  984.             Return _ReadOnly
  985.         End Get
  986.         Set(ByVal value As Boolean)
  987.             _ReadOnly = value
  988.             If TB IsNot Nothing Then
  989.                 TB.ReadOnly = value
  990.             End If
  991.         End Set
  992.     End Property
  993.     Private _UseSystemPasswordChar As Boolean
  994.     <Category("Options")>
  995.     Property UseSystemPasswordChar() As Boolean
  996.         Get
  997.             Return _UseSystemPasswordChar
  998.         End Get
  999.         Set(ByVal value As Boolean)
  1000.             _UseSystemPasswordChar = value
  1001.             If TB IsNot Nothing Then
  1002.                 TB.UseSystemPasswordChar = value
  1003.             End If
  1004.         End Set
  1005.     End Property
  1006.     Private _Multiline As Boolean
  1007.     <Category("Options")>
  1008.     Property Multiline() As Boolean
  1009.         Get
  1010.             Return _Multiline
  1011.         End Get
  1012.         Set(ByVal value As Boolean)
  1013.             _Multiline = value
  1014.             If TB IsNot Nothing Then
  1015.                 TB.Multiline = value
  1016.  
  1017.                 If value Then
  1018.                     TB.Height = Height - 11
  1019.                 Else
  1020.                     Height = TB.Height + 11
  1021.                 End If
  1022.  
  1023.             End If
  1024.         End Set
  1025.     End Property
  1026.     <Category("Options")>
  1027.     Overrides Property Text As String
  1028.         Get
  1029.             Return MyBase.Text
  1030.         End Get
  1031.         Set(ByVal value As String)
  1032.             MyBase.Text = value
  1033.             If TB IsNot Nothing Then
  1034.                 TB.Text = value
  1035.             End If
  1036.         End Set
  1037.     End Property
  1038.     <Category("Options")>
  1039.     Overrides Property Font As Font
  1040.         Get
  1041.             Return MyBase.Font
  1042.         End Get
  1043.         Set(ByVal value As Font)
  1044.             MyBase.Font = value
  1045.             If TB IsNot Nothing Then
  1046.                 TB.Font = value
  1047.                 TB.Location = New Point(3, 5)
  1048.                 TB.Width = Width - 6
  1049.  
  1050.                 If Not _Multiline Then
  1051.                     Height = TB.Height + 11
  1052.                 End If
  1053.             End If
  1054.         End Set
  1055.     End Property
  1056.  
  1057.     Protected Overrides Sub OnCreateControl()
  1058.         MyBase.OnCreateControl()
  1059.         If Not Controls.Contains(TB) Then
  1060.             Controls.Add(TB)
  1061.         End If
  1062.     End Sub
  1063.     Private Sub OnBaseTextChanged(ByVal s As Object, ByVal e As EventArgs)
  1064.         Text = TB.Text
  1065.     End Sub
  1066.     Private Sub OnBaseKeyDown(ByVal s As Object, ByVal e As KeyEventArgs)
  1067.         If e.Control AndAlso e.KeyCode = Keys.A Then
  1068.             TB.SelectAll()
  1069.             e.SuppressKeyPress = True
  1070.         End If
  1071.         If e.Control AndAlso e.KeyCode = Keys.C Then
  1072.             TB.Copy()
  1073.             e.SuppressKeyPress = True
  1074.         End If
  1075.     End Sub
  1076.     Protected Overrides Sub OnResize(ByVal e As EventArgs)
  1077.         TB.Location = New Point(5, 5)
  1078.         TB.Width = Width - 10
  1079.  
  1080.         If _Multiline Then
  1081.             TB.Height = Height - 11
  1082.         Else
  1083.             Height = TB.Height + 11
  1084.         End If
  1085.  
  1086.         MyBase.OnResize(e)
  1087.     End Sub
  1088.  
  1089. #End Region
  1090.  
  1091. #Region " Mouse States "
  1092. ' Get more free themes at ThemesVB.NET
  1093.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  1094.         MyBase.OnMouseDown(e)
  1095.         _State = MouseState.Down
  1096.         Invalidate()
  1097.     End Sub
  1098.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  1099.         MyBase.OnMouseUp(e)
  1100.         _State = MouseState.Over
  1101.         TB.Focus()
  1102.         Invalidate()
  1103.     End Sub
  1104.     Protected Overrides Sub OnMouseEnter(e As EventArgs)
  1105.         MyBase.OnMouseEnter(e)
  1106.         _State = MouseState.Over
  1107.         TB.Focus()
  1108.         Invalidate()
  1109.     End Sub
  1110.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  1111.         MyBase.OnMouseLeave(e)
  1112.         _State = MouseState.None
  1113.         Invalidate()
  1114.     End Sub
  1115.  
  1116. #End Region
  1117.  
  1118. #End Region
  1119.  
  1120.     Sub New()
  1121.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or
  1122.                  ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or
  1123.                  ControlStyles.SupportsTransparentBackColor, True)
  1124.         DoubleBuffered = True
  1125.         BackColor = Color.Transparent
  1126.         TB = New System.Windows.Forms.TextBox
  1127.         TB.Font = New Font("Arial", 9)
  1128.         TB.Text = Text
  1129.         TB.BackColor = Color.FromArgb(40, 40, 40)
  1130.         TB.ForeColor = Color.White
  1131.         TB.MaxLength = _MaxLength
  1132.         TB.Multiline = _Multiline
  1133.         TB.ReadOnly = _ReadOnly
  1134.         TB.UseSystemPasswordChar = _UseSystemPasswordChar
  1135.         TB.BorderStyle = BorderStyle.None
  1136.         TB.Location = New Point(5, 5)
  1137.         TB.Width = Width - 10
  1138.  
  1139.         TB.Cursor = Cursors.IBeam
  1140.  
  1141.         If _Multiline Then
  1142.             TB.Height = Height - 11
  1143.         Else
  1144.             Height = TB.Height + 11
  1145.         End If
  1146.  
  1147.         AddHandler TB.TextChanged, AddressOf OnBaseTextChanged
  1148.         AddHandler TB.KeyDown, AddressOf OnBaseKeyDown
  1149.     End Sub
  1150. #End Region
  1151.  
  1152.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  1153.         MyBase.OnPaint(e)
  1154.         Dim G = e.Graphics
  1155.         G.Clear(Color.FromArgb(40, 40, 40))
  1156.         G.DrawRectangle(New Pen(Color.FromArgb(24, 24, 24)), New Rectangle(0, 0, Width - 1, Height - 1))
  1157.         G.DrawRectangle(New Pen(Color.FromArgb(48, 48, 48)), New Rectangle(1, 1, Width - 3, Height - 3))
  1158.         G.FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(0, 0, 1, 1))
  1159.         G.FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(0, Height - 1, 1, 1))
  1160.         G.FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(Width - 1, 0, 1, 1))
  1161.         G.FillRectangle(New SolidBrush(Color.FromArgb(35, 35, 35)), New Rectangle(Width - 1, Height - 1, 1, 1))
  1162.     End Sub
  1163. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement