Advertisement
xZ3ROxPROJ3CTx

Influence VB.NET Theme [Public]

Oct 11th, 2012
8,115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 58.26 KB | None | 0 0
  1. Imports System, System.IO, System.Collections.Generic, System.Runtime.InteropServices, System.ComponentModel
  2. Imports System.Drawing, System.Drawing.Drawing2D, System.Drawing.Imaging, System.Windows.Forms
  3.  
  4. 'PLEASE LEAVE CREDITS IN SOURCE, DO NOT REDISTRIBUTE!
  5.  
  6. '--------------------- [ Credits ] --------------------
  7. 'Creator: Recuperare
  8. 'Contact: cschaefer2183 (Skype)
  9. 'Created: 10.11.2012
  10. 'Changed: 10.11.2012
  11. '-------------------- [ /Credits ] ---------------------
  12.  
  13. 'PLEASE LEAVE CREDITS IN SOURCE, DO NOT REDISTRIBUTE!
  14. Enum MouseState As Byte
  15.     None = 0
  16.     Over = 1
  17.     Down = 2
  18.     Block = 3
  19. End Enum
  20.  
  21. #Region " GLOBAL FUNCTIONS "
  22.  
  23. Class Draw
  24.     Public Function RoundRect(ByVal Rectangle As Rectangle, ByVal Curve As Integer) As GraphicsPath
  25.         Dim P As GraphicsPath = New GraphicsPath()
  26.         Dim ArcRectangleWidth As Integer = Curve * 2
  27.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  28.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  29.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  30.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  31.         P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
  32.         Return P
  33.     End Function
  34.     Public Function RoundRect(ByVal X As Integer, ByVal Y As Integer, ByVal Width As Integer, ByVal Height As Integer, ByVal Curve As Integer) As GraphicsPath
  35.         Dim Rectangle As Rectangle = New Rectangle(X, Y, Width, Height)
  36.         Dim P As GraphicsPath = New GraphicsPath()
  37.         Dim ArcRectangleWidth As Integer = Curve * 2
  38.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  39.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  40.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  41.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  42.         P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
  43.         Return P
  44.     End Function
  45. End Class
  46.  
  47. #End Region
  48.  
  49.  
  50. Public Class InfluenceTheme : Inherits ContainerControl
  51.  
  52.     #Region " Control Help - Movement & Flicker Control "
  53.     Private MouseP As Point = New Point(0, 0)
  54.     Private Cap As Boolean = False
  55.     Private MoveHeight As Integer
  56.     Private pos As Integer = 0
  57.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  58.         MyBase.OnMouseDown(e)
  59.         If e.Button = Windows.Forms.MouseButtons.Left And New Rectangle(0, 0, Width, MoveHeight).Contains(e.Location) Then
  60.             Cap = True : MouseP = e.Location
  61.         End If
  62.     End Sub
  63.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  64.         MyBase.OnMouseUp(e) : Cap = False
  65.     End Sub
  66.     Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)
  67.         MyBase.OnMouseMove(e)
  68.         If Cap Then
  69.             Parent.Location = MousePosition - MouseP
  70.         End If
  71.     End Sub
  72.     Protected Overrides Sub OnInvalidated(ByVal e As System.Windows.Forms.InvalidateEventArgs)
  73.         MyBase.OnInvalidated(e)
  74.         ParentForm.FindForm.Text = Text
  75.     End Sub
  76.     Protected Overrides Sub OnPaintBackground(ByVal e As System.Windows.Forms.PaintEventArgs)
  77.     End Sub
  78.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  79.         MyBase.OnTextChanged(e)
  80.         Invalidate()
  81.     End Sub
  82.     Protected Overrides Sub OnCreateControl()
  83.         MyBase.OnCreateControl()
  84.         Me.ParentForm.FormBorderStyle = FormBorderStyle.None
  85.     End Sub
  86.     Protected Overrides Sub CreateHandle()
  87.         MyBase.CreateHandle()
  88.     End Sub
  89.     Private _closesEnv As Boolean = False
  90.     Public Property CloseButtonExitsApp() As Boolean
  91.         Get
  92.             Return _closesEnv
  93.         End Get
  94.         Set(ByVal v As Boolean)
  95.             _closesEnv = v
  96.             Invalidate()
  97.         End Set
  98.     End Property
  99.  
  100.     Private _minimBool As Boolean
  101.     Public Property MinimizeButton() As Boolean
  102.         Get
  103.             Return _minimBool
  104.         End Get
  105.         Set(ByVal v As Boolean)
  106.             _minimBool = v
  107.             Invalidate()
  108.         End Set
  109.     End Property
  110.  
  111. #End Region
  112.  
  113.     Dim WithEvents minimBtn As New InfluenceTopButton With {.ButtonIcon = InfluenceTopButton.ButtonType.Minim,
  114.                                                  .Location = New Point(Width - 81, 0)}
  115.     Dim WithEvents closeBtn As New InfluenceTopButton With {.ButtonIcon = InfluenceTopButton.ButtonType.Close,
  116.                                                  .Location = New Point(Width - 52, 0)}
  117.  
  118.     Sub New()
  119.         MyBase.New()
  120.         Dock = DockStyle.Fill
  121.         MoveHeight = 25
  122.         Font = New Font("Verdana", 8.25F)
  123.         DoubleBuffered = True
  124.         Controls.Add(closeBtn)
  125.  
  126.         closeBtn.Refresh() : minimBtn.Refresh()
  127.     End Sub
  128.  
  129.     Private Sub minimBtnClick() Handles minimBtn.Click
  130.         ParentForm.FindForm.WindowState = FormWindowState.Minimized
  131.     End Sub
  132.     Private Sub closeBtnClick() Handles closeBtn.Click
  133.         If CloseButtonExitsApp Then
  134.             System.Environment.Exit(0)
  135.         Else
  136.             ParentForm.FindForm.Close()
  137.         End If
  138.     End Sub
  139.  
  140.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  141.  
  142.         Dim B As New Bitmap(Width, Height)
  143.         Dim G As Graphics = Graphics.FromImage(B)
  144.  
  145.         If _minimBool Then
  146.             Controls.Add(minimBtn)
  147.         Else
  148.             Controls.Remove(minimBtn)
  149.         End If
  150.  
  151.         minimBtn.Location = New Point(Width - 81, 0)
  152.         closeBtn.Location = New Point(Width - 52, 0)
  153.  
  154.         G.SmoothingMode = SmoothingMode.HighSpeed
  155.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  156.         Dim TransparencyKey As Color = Me.ParentForm.TransparencyKey
  157.         Dim d As New Draw()
  158.         MyBase.OnPaint(e)
  159.  
  160.         G.Clear(TransparencyKey)
  161.  
  162.         G.FillPath(New SolidBrush(Color.FromArgb(20, 20, 20)), d.RoundRect(ClientRectangle, 2))
  163.  
  164.  
  165.         Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  166.         Dim g1 As New LinearGradientBrush(New Rectangle(0, 2, Width - 1, 25), Color.FromArgb(40, 40, 40), Color.FromArgb(29, 29, 29), 90S)
  167.  
  168.         G.FillPath(g1, d.RoundRect(New Rectangle(0, 2, Width - 1, 25), 2))
  169.         G.FillPath(h1, d.RoundRect(New Rectangle(0, 2, Width - 1, 25), 2))
  170.  
  171.         Dim s1 As New LinearGradientBrush(g1.Rectangle, Color.FromArgb(15, Color.White), Color.FromArgb(0, Color.White), 90S)
  172.         G.FillRectangle(s1, New Rectangle(1, 1, Width - 1, 13))
  173.  
  174.         G.DrawLine(New Pen(Color.FromArgb(75, Color.White)), 1, 1, Width - 1, 1)
  175.  
  176.         G.DrawLine(New Pen(Color.FromArgb(18, 18, 18)), 1, 26, Width - 1, 26)
  177.  
  178.         G.DrawRectangle(New Pen(Color.FromArgb(37, 37, 37)), New Rectangle(1, 27, Width - 3, Height - 29))
  179.  
  180.         G.DrawPath(Pens.Black, d.RoundRect(ClientRectangle, 2))
  181.  
  182.         G.DrawString(Text, Font, Brushes.Black, New Rectangle(8, 8, Width - 1, 10), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Near})
  183.         G.DrawString(Text, Font, Brushes.White, New Rectangle(8, 9, Width - 1, 11), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Near})
  184.  
  185.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  186.         G.Dispose() : B.Dispose()
  187.     End Sub
  188. End Class
  189.  
  190. Public Class InfluenceButton : Inherits Control
  191.  
  192. #Region " Control Help - MouseState & Flicker Control"
  193.     Private State As MouseState = MouseState.None
  194.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  195.         MyBase.OnMouseEnter(e)
  196.         State = MouseState.Over
  197.         Invalidate()
  198.     End Sub
  199.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  200.         MyBase.OnMouseDown(e)
  201.         State = MouseState.Down
  202.         Invalidate()
  203.     End Sub
  204.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  205.         MyBase.OnMouseLeave(e)
  206.         State = MouseState.None
  207.         Invalidate()
  208.     End Sub
  209.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  210.         MyBase.OnMouseUp(e)
  211.         State = MouseState.Over
  212.         Invalidate()
  213.     End Sub
  214.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  215.         MyBase.OnTextChanged(e)
  216.         Invalidate()
  217.     End Sub
  218.     Private _align As StringAlignment = StringAlignment.Near
  219.     Public Shadows Property TextAlignment() As StringAlignment
  220.         Get
  221.             Return _align
  222.         End Get
  223.         Set(ByVal v As StringAlignment)
  224.             _align = v
  225.             Invalidate()
  226.         End Set
  227.     End Property
  228.  
  229. #End Region
  230.  
  231.     Sub New()
  232.         MyBase.New()
  233.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  234.         BackColor = Color.Transparent
  235.         Font = New Font("Verdana", 8.25F)
  236.         DoubleBuffered = True
  237.         Size = New Size(115, 30)
  238.     End Sub
  239.  
  240.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  241.         Dim B As New Bitmap(Width, Height)
  242.         Dim G As Graphics = Graphics.FromImage(B)
  243.  
  244.         Dim ClientRectangle = New Rectangle(0, 0, Width - 1, Height - 1)
  245.  
  246.         Dim d As New Draw()
  247.         G.SmoothingMode = SmoothingMode.HighQuality
  248.         'G.Clear(Color.FromArgb(20, 20, 20))
  249.         G.Clear(BackColor)
  250.  
  251.         Select Case State
  252.             Case MouseState.None 'Mouse None
  253.                 G.FillPath(New SolidBrush(Color.FromArgb(20, 20, 20)), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), 2))
  254.                 Dim g1 As New LinearGradientBrush(ClientRectangle, Color.FromArgb(125, 78, 75, 73), Color.FromArgb(125, 61, 59, 55), 90S)
  255.                 G.FillPath(g1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), 2))
  256.                 Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  257.                 G.FillPath(h1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), 2))
  258.                 Dim s1 As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2), Color.FromArgb(35, Color.White), Color.FromArgb(0, Color.White), 90S)
  259.                 G.FillPath(s1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height / 2 - 1), 2))
  260.                 G.DrawPath(New Pen(Color.FromArgb(150, 97, 94, 90)), d.RoundRect(New Rectangle(0, 1, Width - 1, Height - 3), 2))
  261.                 G.DrawPath(New Pen(Color.FromArgb(0, 0, 0)), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 2))
  262.             Case MouseState.Over 'Mouse Hover
  263.                 Dim g1 As New LinearGradientBrush(ClientRectangle, Color.FromArgb(125, 78, 75, 73), Color.FromArgb(125, 61, 59, 55), 90S)
  264.                 G.FillPath(g1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), 2))
  265.                 'G.FillRectangle(g1, ClientRectangle)
  266.                 Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  267.                 G.FillPath(h1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), 2))
  268.                 'G.FillRectangle(h1, New Rectangle(0, 0, Width - 1, Height - 2))
  269.                 Dim s1 As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2), Color.FromArgb(35, Color.White), Color.FromArgb(0, Color.White), 90S)
  270.                 G.FillPath(s1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height / 2 - 1), 2))
  271.                 G.FillPath(New SolidBrush(Color.FromArgb(15, Color.White)), d.RoundRect(ClientRectangle, 2))
  272.                 G.DrawPath(New Pen(Color.FromArgb(150, 97, 94, 90)), d.RoundRect(New Rectangle(0, 1, Width - 1, Height - 3), 2))
  273.                 G.DrawPath(New Pen(Color.FromArgb(0, 0, 0)), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 2))
  274.             Case MouseState.Down 'Mouse Down
  275.                 Dim g1 As New LinearGradientBrush(ClientRectangle, Color.FromArgb(125, 78, 75, 73), Color.FromArgb(125, 61, 59, 55), 90S)
  276.                 G.FillPath(g1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), 2))
  277.                 'G.FillRectangle(g1, ClientRectangle)
  278.                 Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  279.                 G.FillPath(h1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), 2))
  280.                 'G.FillRectangle(h1, New Rectangle(0, 0, Width - 1, Height - 2))
  281.                 Dim s1 As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2), Color.FromArgb(35, Color.White), Color.FromArgb(0, Color.White), 90S)
  282.                 G.FillPath(s1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height / 2 - 1), 2))
  283.                 G.FillPath(New SolidBrush(Color.FromArgb(15, Color.Black)), d.RoundRect(ClientRectangle, 2))
  284.                 G.DrawPath(New Pen(Color.FromArgb(150, 97, 94, 90)), d.RoundRect(New Rectangle(0, 1, Width - 1, Height - 3), 2))
  285.                 G.DrawPath(New Pen(Color.FromArgb(0, 0, 0)), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 2))
  286.         End Select
  287.  
  288.         'G.DrawRectangle(Pens.Black, ClientRectangle)
  289.  
  290.         G.DrawString(Text, Font, Brushes.Black, New Rectangle(5, 0, Width - 1, Height - 1), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = _align})
  291.         G.DrawString(Text, Font, Brushes.White, New Rectangle(5, 1, Width - 1, Height - 1), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = _align})
  292.  
  293.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  294.         G.Dispose() : B.Dispose()
  295.     End Sub
  296. End Class
  297.  
  298. Public Class InfluenceTopButton : Inherits Control
  299. #Region " Control Help - MouseState & Flicker Control"
  300.     Enum ButtonType As Byte
  301.         Blank = 0
  302.         Close = 1
  303.         Minim = 2
  304.     End Enum
  305.     Private State As MouseState = MouseState.None
  306.  
  307.     Private _type As ButtonType = ButtonType.Blank
  308.     Public Property ButtonIcon() As ButtonType
  309.         Get
  310.             Return _type
  311.         End Get
  312.         Set(ByVal v As ButtonType)
  313.             _type = v
  314.             Invalidate()
  315.         End Set
  316.     End Property
  317.  
  318.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  319.         MyBase.OnMouseEnter(e)
  320.         State = MouseState.Over
  321.         Invalidate()
  322.     End Sub
  323.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  324.         MyBase.OnMouseDown(e)
  325.         State = MouseState.Down
  326.         Invalidate()
  327.     End Sub
  328.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  329.         MyBase.OnMouseLeave(e)
  330.         State = MouseState.None
  331.         Invalidate()
  332.     End Sub
  333.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  334.         MyBase.OnMouseUp(e)
  335.         State = MouseState.Over
  336.         Invalidate()
  337.     End Sub
  338.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  339.         MyBase.OnTextChanged(e)
  340.         Invalidate()
  341.     End Sub
  342. #End Region
  343.  
  344.     Sub New()
  345.         MyBase.New()
  346.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  347.         BackColor = Color.Transparent
  348.         Font = New Font("Verdana", 8.25F)
  349.         Size = New Size(43, 21)
  350.         DoubleBuffered = True
  351.         Focus()
  352.     End Sub
  353.  
  354.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  355.         Dim B As New Bitmap(Width, Height)
  356.         Dim G As Graphics = Graphics.FromImage(B)
  357.         Dim d As New Draw()
  358.  
  359.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  360.  
  361.         G.Clear(BackColor)
  362.  
  363.         Select Case State
  364.             Case MouseState.None 'Mouse None
  365.                 Dim g1 As New LinearGradientBrush(ClientRectangle, Color.FromArgb(125, 78, 75, 73), Color.FromArgb(125, 61, 59, 55), 90S)
  366.                 G.FillRectangle(g1, g1.Rectangle)
  367.                 Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  368.                 G.FillRectangle(h1, g1.Rectangle)
  369.                 Dim s1 As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2), Color.FromArgb(35, Color.White), Color.FromArgb(0, Color.White), 90S)
  370.                 G.FillRectangle(s1, s1.Rectangle)
  371.                 G.DrawRectangle(New Pen(Color.FromArgb(150, 97, 94, 90)), New Rectangle(0, 1, Width - 1, Height - 3))
  372.                 G.DrawRectangle(New Pen(Color.FromArgb(20, 20, 20)), New Rectangle(0, 0, Width - 1, Height - 1))
  373.             Case MouseState.Over
  374.                 Dim g1 As New LinearGradientBrush(ClientRectangle, Color.FromArgb(125, 78, 75, 73), Color.FromArgb(125, 61, 59, 55), 90S)
  375.                 G.FillRectangle(g1, g1.Rectangle)
  376.                 Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  377.                 G.FillRectangle(h1, g1.Rectangle)
  378.                 Dim s1 As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2), Color.FromArgb(35, Color.White), Color.FromArgb(0, Color.White), 90S)
  379.                 G.FillRectangle(s1, s1.Rectangle)
  380.                 G.FillRectangle(New SolidBrush(Color.FromArgb(15, Color.White)), New Rectangle(0, 0, Width - 1, Height - 1))
  381.                 G.DrawRectangle(New Pen(Color.FromArgb(150, 97, 94, 90)), New Rectangle(0, 1, Width - 1, Height - 3))
  382.                 G.DrawRectangle(New Pen(Color.FromArgb(20, 20, 20)), New Rectangle(0, 0, Width - 1, Height - 1))
  383.             Case MouseState.Down
  384.                 Dim g1 As New LinearGradientBrush(ClientRectangle, Color.FromArgb(125, 78, 75, 73), Color.FromArgb(125, 61, 59, 55), 90S)
  385.                 G.FillRectangle(g1, g1.Rectangle)
  386.                 Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  387.                 G.FillRectangle(h1, g1.Rectangle)
  388.                 Dim s1 As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2), Color.FromArgb(35, Color.White), Color.FromArgb(0, Color.White), 90S)
  389.                 G.FillRectangle(s1, s1.Rectangle)
  390.                 G.FillRectangle(New SolidBrush(Color.FromArgb(15, Color.Black)), New Rectangle(0, 0, Width - 1, Height - 1))
  391.                 G.DrawRectangle(New Pen(Color.FromArgb(150, 97, 94, 90)), New Rectangle(0, 1, Width - 1, Height - 3))
  392.                 G.DrawRectangle(New Pen(Color.FromArgb(20, 20, 20)), New Rectangle(0, 0, Width - 1, Height - 1))
  393.         End Select
  394.  
  395.         Select Case _type
  396.             Case ButtonType.Close
  397.                 Size = New Size(43, 21)
  398.                 G.DrawString("r", New Font("Marlett", 8.75), New SolidBrush(Color.FromArgb(220, Color.White)), New Rectangle(0, 0, Width - 1, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  399.             Case ButtonType.Minim
  400.                 Size = New Size(30, 21)
  401.                 G.DrawString("0", New Font("Marlett", 8.75), New SolidBrush(Color.FromArgb(220, Color.White)), New Rectangle(1.5, 0, Width - 1, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  402.         End Select
  403.  
  404.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  405.         G.Dispose() : B.Dispose()
  406.     End Sub
  407. End Class
  408.  
  409. Public Class InfluenceProgressBar : Inherits Control
  410.  
  411. #Region " Control Help - Properties & Flicker Control "
  412.     Private OFS As Integer = 0
  413.     Private Speed As Integer = 50
  414.     Private _Maximum As Integer = 100
  415.     Public Property Maximum() As Integer
  416.         Get
  417.             Return _Maximum
  418.         End Get
  419.         Set(ByVal v As Integer)
  420.             Select Case v
  421.                 Case Is < _Value
  422.                     _Value = v
  423.             End Select
  424.             _Maximum = v
  425.             Invalidate()
  426.         End Set
  427.     End Property
  428.     Private _Value As Integer = 0
  429.     Public Property Value() As Integer
  430.         Get
  431.             Select Case _Value
  432.                 Case 0
  433.                     Return 0
  434.                 Case Else
  435.                     Return _Value
  436.             End Select
  437.         End Get
  438.         Set(ByVal v As Integer)
  439.             Select Case v
  440.                 Case Is > _Maximum
  441.                     v = _Maximum
  442.             End Select
  443.             _Value = v
  444.             Invalidate()
  445.         End Set
  446.     End Property
  447.     Private _ShowPercentage As Boolean = False
  448.     Public Property ShowPercentage() As Boolean
  449.         Get
  450.             Return _ShowPercentage
  451.         End Get
  452.         Set(ByVal v As Boolean)
  453.             _ShowPercentage = v
  454.             Invalidate()
  455.         End Set
  456.     End Property
  457.  
  458.     Protected Overrides Sub CreateHandle()
  459.         MyBase.CreateHandle()
  460.         ' Dim tmr As New Timer With {.Interval = Speed}
  461.         ' AddHandler tmr.Tick, AddressOf Animate
  462.         ' tmr.Start()
  463.         Dim T As New Threading.Thread(AddressOf Animate)
  464.         T.IsBackground = True
  465.         'T.Start()
  466.     End Sub
  467.     Sub Animate()
  468.         While True
  469.             If OFS <= Width Then : OFS += 1
  470.             Else : OFS = 0
  471.             End If
  472.             Invalidate()
  473.             Threading.Thread.Sleep(Speed)
  474.         End While
  475.     End Sub
  476. #End Region
  477.  
  478.     Sub New()
  479.         MyBase.New()
  480.         DoubleBuffered = True
  481.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  482.         BackColor = Color.Transparent
  483.     End Sub
  484.  
  485.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  486.         Dim B As New Bitmap(Width, Height)
  487.         Dim G As Graphics = Graphics.FromImage(B)
  488.         G.SmoothingMode = SmoothingMode.HighQuality
  489.         Dim d As New Draw()
  490.  
  491.         Dim intValue As Integer = CInt(_Value / _Maximum * Width)
  492.         G.Clear(BackColor)
  493.  
  494.         Dim gB As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height - 1), Color.FromArgb(16, 16, 16), Color.FromArgb(22, 22, 22), 90S)
  495.         G.FillPath(gB, d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 2))
  496.         Dim g1 As New LinearGradientBrush(New Rectangle(0, 0, intValue - 1, Height - 2), Color.FromArgb(125, 78, 75, 73), Color.FromArgb(125, 61, 59, 55), 90S)
  497.         G.FillPath(g1, d.RoundRect(New Rectangle(0, 0, intValue - 1, Height - 2), 2))
  498.         Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  499.         G.FillPath(h1, d.RoundRect(New Rectangle(0, 0, intValue - 1, Height - 2), 2))
  500.         Dim s1 As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2), Color.FromArgb(35, Color.White), Color.FromArgb(0, Color.White), 90S)
  501.         G.FillPath(s1, d.RoundRect(New Rectangle(0, 0, intValue - 1, Height / 2 - 1), 2))
  502.  
  503.         G.DrawPath(New Pen(Color.FromArgb(125, 97, 94, 90)), d.RoundRect(New Rectangle(0, 1, Width - 1, Height - 3), 2))
  504.         G.DrawPath(New Pen(Color.FromArgb(0, 0, 0)), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 2))
  505.  
  506.         G.DrawPath(New Pen(Color.FromArgb(150, 97, 94, 90)), d.RoundRect(New Rectangle(0, 0, intValue - 1, Height - 1), 2))
  507.         G.DrawPath(New Pen(Color.FromArgb(0, 0, 0)), d.RoundRect(New Rectangle(0, 0, intValue - 1, Height - 1), 2))
  508.  
  509.         If _ShowPercentage Then
  510.             G.DrawString(Convert.ToString(String.Concat(Value, "%")), Font, Brushes.White, New Rectangle(0, 0, Width - 1, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  511.         End If
  512.  
  513.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  514.         G.Dispose() : B.Dispose()
  515.     End Sub
  516. End Class
  517.  
  518. Public Class InfluenceMultiLineTextBox : Inherits Control
  519.     Dim WithEvents txtbox As New TextBox
  520.  
  521. #Region " Control Help - Properties & Flicker Control "
  522.     Private _maxchars As Integer = 32767
  523.     Public Property MaxCharacters() As Integer
  524.         Get
  525.             Return _maxchars
  526.         End Get
  527.         Set(ByVal v As Integer)
  528.             _maxchars = v
  529.             Invalidate()
  530.         End Set
  531.     End Property
  532.     Private _align As HorizontalAlignment
  533.     Public Shadows Property TextAlignment() As HorizontalAlignment
  534.         Get
  535.             Return _align
  536.         End Get
  537.         Set(ByVal v As HorizontalAlignment)
  538.             _align = v
  539.             Invalidate()
  540.         End Set
  541.     End Property
  542.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  543.         MyBase.OnTextChanged(e)
  544.         Invalidate()
  545.     End Sub
  546.     Protected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)
  547.         MyBase.OnBackColorChanged(e)
  548.         txtbox.BackColor = Color.FromArgb(43, 43, 43)
  549.         Invalidate()
  550.     End Sub
  551.     Protected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)
  552.         MyBase.OnForeColorChanged(e)
  553.         txtbox.ForeColor = ForeColor
  554.         Invalidate()
  555.     End Sub
  556.     Protected Overrides Sub OnSizeChanged(ByVal e As System.EventArgs)
  557.         MyBase.OnSizeChanged(e)
  558.         txtbox.Size = New Size(Width - 10, Height - 11)
  559.     End Sub
  560.     Protected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)
  561.         MyBase.OnFontChanged(e)
  562.         txtbox.Font = Font
  563.     End Sub
  564.     Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
  565.         MyBase.OnGotFocus(e)
  566.         txtbox.Focus()
  567.     End Sub
  568.     Sub TextChngTxtBox() Handles txtbox.TextChanged
  569.         Text = txtbox.Text
  570.     End Sub
  571.     Sub TextChng() Handles MyBase.TextChanged
  572.         txtbox.Text = Text
  573.     End Sub
  574.     Sub NewTextBox()
  575.         With txtbox
  576.             .Multiline = True
  577.             .BackColor = BackColor
  578.             .ForeColor = ForeColor
  579.             .Text = String.Empty
  580.             .TextAlign = HorizontalAlignment.Center
  581.             .BorderStyle = BorderStyle.None
  582.             .Location = New Point(3, 4)
  583.             .Font = New Font("Verdana", 8.25)
  584.             .Size = New Size(Width - 10, Height - 10)
  585.         End With
  586.         txtbox.Font = New Font("Verdana", 8.25)
  587.     End Sub
  588. #End Region
  589.  
  590.     Sub New()
  591.         MyBase.New()
  592.  
  593.         NewTextBox()
  594.         Controls.Add(txtbox)
  595.  
  596.         Text = String.Empty
  597.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  598.         BackColor = Color.Transparent
  599.         ForeColor = Color.White
  600.         Size = New Size(135, 35)
  601.         DoubleBuffered = True
  602.     End Sub
  603.  
  604.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  605.         Dim B As New Bitmap(Width, Height)
  606.         Dim G As Graphics = Graphics.FromImage(B)
  607.         G.SmoothingMode = SmoothingMode.HighQuality
  608.         Dim d As New Draw()
  609.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  610.  
  611.         txtbox.TextAlign = TextAlignment
  612.  
  613.         G.Clear(BackColor)
  614.  
  615.         Dim g1 As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2), Color.FromArgb(40, 40, 40), Color.FromArgb(45, 45, 45), 90S)
  616.         G.FillPath(g1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height / 2), 2))
  617.         Dim g2 As New LinearGradientBrush(New Rectangle(0, Height / 2, Width - 1, Height / 2), Color.FromArgb(45, 45, 45), Color.FromArgb(40, 40, 40), 90S)
  618.         G.FillPath(g2, d.RoundRect(New Rectangle(0, Height / 2 - 3, Width - 1, Height / 2 + 2), 2))
  619.  
  620.         G.DrawPath(New Pen(Color.FromArgb(150, 97, 94, 90)), d.RoundRect(New Rectangle(0, 1, Width - 1, Height - 3), 2))
  621.         G.DrawPath(New Pen(Color.FromArgb(10, 10, 10)), d.RoundRect(ClientRectangle, 2))
  622.  
  623.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  624.         G.Dispose() : B.Dispose()
  625.     End Sub
  626. End Class
  627.  
  628. Public Class InfluenceTextBox : Inherits Control
  629.     Dim WithEvents txtbox As New TextBox
  630.  
  631. #Region " Control Help - Properties & Flicker Control "
  632.     Private _passmask As Boolean = False
  633.     Public Shadows Property UseSystemPasswordChar() As Boolean
  634.         Get
  635.             Return _passmask
  636.         End Get
  637.         Set(ByVal v As Boolean)
  638.             txtbox.UseSystemPasswordChar = UseSystemPasswordChar
  639.             _passmask = v
  640.             Invalidate()
  641.         End Set
  642.     End Property
  643.     Private _maxchars As Integer = 32767
  644.     Public Shadows Property MaxLength() As Integer
  645.         Get
  646.             Return _maxchars
  647.         End Get
  648.         Set(ByVal v As Integer)
  649.             _maxchars = v
  650.             txtbox.MaxLength = MaxLength
  651.             Invalidate()
  652.         End Set
  653.     End Property
  654.     Private _align As HorizontalAlignment
  655.     Public Shadows Property TextAlignment() As HorizontalAlignment
  656.         Get
  657.             Return _align
  658.         End Get
  659.         Set(ByVal v As HorizontalAlignment)
  660.             _align = v
  661.             Invalidate()
  662.         End Set
  663.     End Property
  664.  
  665.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  666.         MyBase.OnTextChanged(e)
  667.         Invalidate()
  668.     End Sub
  669.     Protected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)
  670.         MyBase.OnBackColorChanged(e)
  671.         txtbox.BackColor = Color.FromArgb(43, 43, 43)
  672.         Invalidate()
  673.     End Sub
  674.     Protected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)
  675.         MyBase.OnForeColorChanged(e)
  676.         txtbox.ForeColor = ForeColor
  677.         Invalidate()
  678.     End Sub
  679.     Protected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)
  680.         MyBase.OnFontChanged(e)
  681.         txtbox.Font = Font
  682.     End Sub
  683.     Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
  684.         MyBase.OnGotFocus(e)
  685.         txtbox.Focus()
  686.     End Sub
  687.     Sub TextChngTxtBox() Handles txtbox.TextChanged
  688.         Text = txtbox.Text
  689.     End Sub
  690.     Sub TextChng() Handles MyBase.TextChanged
  691.         txtbox.Text = Text
  692.     End Sub
  693.     Sub NewTextBox()
  694.         With txtbox
  695.             .Multiline = False
  696.             .BackColor = Color.FromArgb(43, 43, 43)
  697.             .ForeColor = ForeColor
  698.             .Text = String.Empty
  699.             .TextAlign = HorizontalAlignment.Center
  700.             .BorderStyle = BorderStyle.None
  701.             .Location = New Point(5, 5)
  702.             .Font = New Font("Verdana", 8.25)
  703.             .Size = New Size(Width - 10, Height - 11)
  704.             .UseSystemPasswordChar = UseSystemPasswordChar
  705.         End With
  706.  
  707.     End Sub
  708. #End Region
  709.  
  710.     Sub New()
  711.         MyBase.New()
  712.  
  713.         NewTextBox()
  714.         Controls.Add(txtbox)
  715.  
  716.         Text = ""
  717.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  718.         BackColor = Color.Transparent
  719.         ForeColor = Color.White
  720.         Size = New Size(135, 35)
  721.         DoubleBuffered = True
  722.     End Sub
  723.  
  724.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  725.         Dim B As New Bitmap(Width, Height)
  726.         Dim G As Graphics = Graphics.FromImage(B)
  727.         G.SmoothingMode = SmoothingMode.HighQuality
  728.         Dim d As New Draw()
  729.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  730.  
  731.         Height = txtbox.Height + 11
  732.         With txtbox
  733.             .Width = Width - 10
  734.             .TextAlign = TextAlignment
  735.             .UseSystemPasswordChar = UseSystemPasswordChar
  736.         End With
  737.  
  738.         G.Clear(BackColor)
  739.  
  740.         Dim g1 As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2), Color.FromArgb(40, 40, 40), Color.FromArgb(45, 45, 45), 90S)
  741.         G.FillPath(g1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height / 2), 2))
  742.         Dim g2 As New LinearGradientBrush(New Rectangle(0, Height / 2, Width - 1, Height / 2), Color.FromArgb(45, 45, 45), Color.FromArgb(40, 40, 40), 90S)
  743.         G.FillPath(g2, d.RoundRect(New Rectangle(0, Height / 2 - 3, Width - 1, Height / 2 + 2), 2))
  744.  
  745.         G.DrawPath(New Pen(Color.FromArgb(150, 97, 94, 90)), d.RoundRect(New Rectangle(0, 1, Width - 1, Height - 3), 2))
  746.         G.DrawPath(New Pen(Color.FromArgb(10, 10, 10)), d.RoundRect(ClientRectangle, 2))
  747.  
  748.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  749.         G.Dispose() : B.Dispose()
  750.     End Sub
  751. End Class
  752.  
  753. Public Class InfluenceListBox : Inherits Control
  754.     Public WithEvents lstbox As New ListBox
  755.     Private __Items As String() = {""}
  756.  
  757. #Region " Control Help - Properties & Flicker Control "
  758.     Protected Overrides Sub OnSizeChanged(ByVal e As System.EventArgs)
  759.         MyBase.OnSizeChanged(e)
  760.         lstbox.Size = New Size(Width - 6, Height - 6)
  761.         Invalidate()
  762.     End Sub
  763.     Protected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)
  764.         MyBase.OnBackColorChanged(e)
  765.         lstbox.BackColor = Color.FromArgb(43, 43, 43)
  766.         Invalidate()
  767.     End Sub
  768.     Protected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)
  769.         MyBase.OnForeColorChanged(e)
  770.         lstbox.ForeColor = ForeColor
  771.         Invalidate()
  772.     End Sub
  773.     Protected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)
  774.         MyBase.OnFontChanged(e)
  775.         lstbox.Font = Font
  776.     End Sub
  777.     Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
  778.         MyBase.OnGotFocus(e)
  779.         lstbox.Focus()
  780.     End Sub
  781.     Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  782.         MyBase.OnResize(e)
  783.         lstbox.Size = New Size(Width - 11, Height - 11)
  784.         Invalidate()
  785.     End Sub
  786.     Public Property Items As String()
  787.         Get
  788.             Return __Items
  789.             Invalidate()
  790.         End Get
  791.         Set(ByVal value As String())
  792.             __Items = value
  793.             lstbox.Items.Clear()
  794.             Invalidate()
  795.             lstbox.Items.AddRange(value)
  796.             Invalidate()
  797.         End Set
  798.     End Property
  799.     Public ReadOnly Property SelectedItem() As String
  800.         Get
  801.             Return lstbox.SelectedItem
  802.         End Get
  803.     End Property
  804.     Sub DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles lstbox.DrawItem
  805.         Try
  806.             e.DrawBackground()
  807.             e.Graphics.DrawString(lstbox.Items(e.Index).ToString(), _
  808.             e.Font, New SolidBrush(lstbox.ForeColor), e.Bounds, StringFormat.GenericDefault)
  809.             e.DrawFocusRectangle()
  810.         Catch
  811.         End Try
  812.     End Sub
  813.     Sub AddRange(ByVal Items As Object())
  814.         lstbox.Items.Remove("")
  815.         lstbox.Items.AddRange(Items)
  816.         Invalidate()
  817.     End Sub
  818.     Sub AddItem(ByVal Item As Object)
  819.         lstbox.Items.Add(Item)
  820.         Invalidate()
  821.     End Sub
  822.     Sub NewListBox()
  823.         lstbox.Size = New Size(Width - 8, Height - 8)
  824.         lstbox.BorderStyle = BorderStyle.None
  825.         lstbox.DrawMode = DrawMode.OwnerDrawVariable
  826.         lstbox.Location = New Point(3, 3)
  827.         lstbox.ForeColor = Color.White
  828.         lstbox.BackColor = Color.FromArgb(43, 43, 43)
  829.         lstbox.Items.Clear()
  830.     End Sub
  831.  
  832. #End Region
  833.  
  834.     Sub New()
  835.         MyBase.New()
  836.  
  837.         NewListBox()
  838.         Controls.Add(lstbox)
  839.  
  840.         Size = New Size(128, 108)
  841.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  842.         BackColor = Color.Transparent
  843.         DoubleBuffered = True
  844.     End Sub
  845.  
  846.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  847.         Dim B As New Bitmap(Width, Height)
  848.         Dim G As Graphics = Graphics.FromImage(B)
  849.         G.SmoothingMode = SmoothingMode.HighQuality
  850.         Dim d As New Draw()
  851.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  852.         lstbox.Size = New Size(Width - 7, Height - 7)
  853.  
  854.         G.Clear(BackColor)
  855.  
  856.         Dim g1 As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2), Color.FromArgb(40, 40, 40), Color.FromArgb(45, 45, 45), 90S)
  857.         G.FillPath(g1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height / 2), 2))
  858.         Dim g2 As New LinearGradientBrush(New Rectangle(0, Height / 2, Width - 1, Height / 2), Color.FromArgb(45, 45, 45), Color.FromArgb(40, 40, 40), 90S)
  859.         G.FillPath(g2, d.RoundRect(New Rectangle(0, Height / 2 - 3, Width - 1, Height / 2 + 2), 2))
  860.  
  861.         G.DrawPath(New Pen(Color.FromArgb(150, 97, 94, 90)), d.RoundRect(New Rectangle(0, 1, Width - 1, Height - 3), 2))
  862.         G.DrawPath(New Pen(Color.FromArgb(10, 10, 10)), d.RoundRect(ClientRectangle, 2))
  863.  
  864.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  865.         G.Dispose() : B.Dispose()
  866.     End Sub
  867. End Class
  868.  
  869. Public Class InfluenceComboBox : Inherits ComboBox
  870. #Region " Control Help - Properties & Flicker Control "
  871.     Private _StartIndex As Integer = 0
  872.     Public Property StartIndex As Integer
  873.         Get
  874.             Return _StartIndex
  875.         End Get
  876.         Set(ByVal value As Integer)
  877.             _StartIndex = value
  878.             Try
  879.                 MyBase.SelectedIndex = value
  880.             Catch
  881.             End Try
  882.             Invalidate()
  883.         End Set
  884.     End Property
  885.     Sub ReplaceItem(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles Me.DrawItem
  886.         e.DrawBackground()
  887.         Try
  888.             If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then
  889.                 e.Graphics.FillRectangle(New SolidBrush(_highlightColor), e.Bounds) '37 37 37
  890.             End If
  891.             Using b As New SolidBrush(e.ForeColor)
  892.                 e.Graphics.DrawString(MyBase.GetItemText(MyBase.Items(e.Index)), e.Font, b, e.Bounds)
  893.             End Using
  894.         Catch
  895.         End Try
  896.         e.DrawFocusRectangle()
  897.         Invalidate()
  898.     End Sub
  899.     Protected Sub DrawTriangle(ByVal Clr As Color, ByVal FirstPoint As Point, ByVal SecondPoint As Point, ByVal ThirdPoint As Point, ByVal G As Graphics)
  900.         Dim points As New List(Of Point)()
  901.         points.Add(FirstPoint)
  902.         points.Add(SecondPoint)
  903.         points.Add(ThirdPoint)
  904.         G.FillPolygon(New SolidBrush(Clr), points.ToArray)
  905.     End Sub
  906.     Private _highlightColor As Color = Color.FromArgb(128, 128, 128)
  907.     Public Property ItemHighlightColor() As Color
  908.         Get
  909.             Return _highlightColor
  910.         End Get
  911.         Set(ByVal v As Color)
  912.             _highlightColor = v
  913.             Invalidate()
  914.         End Set
  915.     End Property
  916.  
  917. #End Region
  918.  
  919.     Sub New()
  920.         MyBase.New()
  921.         SetStyle(ControlStyles.AllPaintingInWmPaint Or _
  922.         ControlStyles.ResizeRedraw Or _
  923.         ControlStyles.UserPaint Or _
  924.         ControlStyles.DoubleBuffer Or _
  925.         ControlStyles.SupportsTransparentBackColor, True)
  926.         DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
  927.         BackColor = Color.Transparent
  928.         ForeColor = Color.White
  929.         DropDownStyle = ComboBoxStyle.DropDownList
  930.         DoubleBuffered = True
  931.         Invalidate()
  932.     End Sub
  933.  
  934.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  935.         Dim B As New Bitmap(Width, Height)
  936.         Dim G As Graphics = Graphics.FromImage(B)
  937.         Dim d As New Draw()
  938.  
  939.         G.SmoothingMode = SmoothingMode.HighQuality
  940.         G.Clear(BackColor)
  941.  
  942.         Dim g1 As New LinearGradientBrush(ClientRectangle, Color.FromArgb(125, 78, 75, 73), Color.FromArgb(125, 61, 59, 55), 90S)
  943.         G.FillPath(g1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), 2))
  944.         'G.FillRectangle(g1, ClientRectangle)
  945.         Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  946.         G.FillPath(h1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), 2))
  947.         'G.FillRectangle(h1, New Rectangle(0, 0, Width - 1, Height - 2))
  948.         Dim s1 As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2), Color.FromArgb(35, Color.White), Color.FromArgb(0, Color.White), 90S)
  949.         G.FillPath(s1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height / 2 - 1), 2))
  950.         G.DrawLine(New Pen(Color.FromArgb(85, 83, 80)), Width - 18, 0, Width - 18, Height - 1)
  951.         G.DrawLine(New Pen(Color.FromArgb(15, 13, 10)), Width - 19, 0, Width - 19, Height - 1)
  952.         G.DrawPath(New Pen(Color.FromArgb(150, 97, 94, 90)), d.RoundRect(New Rectangle(0, 1, Width - 1, Height - 3), 2))
  953.         G.DrawPath(New Pen(Color.FromArgb(0, 0, 0)), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 2))
  954.         '                                      Far Point                Near Point                Middle Point
  955.         DrawTriangle(Color.White, New Point(Width - 14, 12), New Point(Width - 7, 12), New Point(Width - 11, 15), G)
  956.         DrawTriangle(Color.White, New Point(Width - 14, 9), New Point(Width - 7, 9), New Point(Width - 11, 6), G)
  957.  
  958.         Try
  959.             G.DrawString(Text, Font, Brushes.White, New Rectangle(3, 0, Width - 20, Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Near})
  960.         Catch
  961.         End Try
  962.  
  963.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  964.         G.Dispose() : B.Dispose()
  965.     End Sub
  966. End Class
  967.  
  968. <DefaultEvent("CheckedChanged")> Public Class InfluenceCheckBox : Inherits Control
  969.  
  970. #Region " Control Help - MouseState & Flicker Control"
  971.     Private State As MouseState = MouseState.None
  972.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  973.         MyBase.OnMouseEnter(e)
  974.         State = MouseState.Over
  975.         Invalidate()
  976.     End Sub
  977.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  978.         MyBase.OnMouseDown(e)
  979.         State = MouseState.Down
  980.         Invalidate()
  981.     End Sub
  982.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  983.         MyBase.OnMouseLeave(e)
  984.         State = MouseState.None
  985.         Invalidate()
  986.     End Sub
  987.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  988.         MyBase.OnMouseUp(e)
  989.         State = MouseState.Over
  990.         Invalidate()
  991.     End Sub
  992.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  993.         MyBase.OnTextChanged(e)
  994.         Invalidate()
  995.     End Sub
  996.     Private _Checked As Boolean
  997.     Property Checked() As Boolean
  998.         Get
  999.             Return _Checked
  1000.         End Get
  1001.         Set(ByVal value As Boolean)
  1002.             _Checked = value
  1003.             Invalidate()
  1004.         End Set
  1005.     End Property
  1006.     Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  1007.         MyBase.OnResize(e)
  1008.         Height = 16
  1009.     End Sub
  1010.     Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
  1011.         _Checked = Not _Checked
  1012.         RaiseEvent CheckedChanged(Me)
  1013.         MyBase.OnClick(e)
  1014.     End Sub
  1015.     Event CheckedChanged(ByVal sender As Object)
  1016. #End Region
  1017.  
  1018.     Sub New()
  1019.         MyBase.New()
  1020.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  1021.         BackColor = Color.Transparent
  1022.         ForeColor = Color.White
  1023.         Size = New Size(145, 16)
  1024.         DoubleBuffered = True
  1025.     End Sub
  1026.  
  1027.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  1028.         Dim B As New Bitmap(Width, Height)
  1029.         Dim G As Graphics = Graphics.FromImage(B)
  1030.         Dim d As New Draw()
  1031.  
  1032.         Dim checkBoxRectangle As New Rectangle(0, 0, Height - 1, Height - 1)
  1033.  
  1034.         G.Clear(BackColor)
  1035.  
  1036.         Select Case Checked
  1037.             Case False
  1038.                 Dim g1 As New LinearGradientBrush(checkBoxRectangle, Color.FromArgb(10, 10, 10), Color.FromArgb(16, 16, 16), 90S)
  1039.                 G.FillPath(g1, d.RoundRect(checkBoxRectangle, 2))
  1040.                 G.DrawPath(New Pen(Color.FromArgb(80, 97, 94, 90)), d.RoundRect(New Rectangle(1, 1, Height - 3, Height - 3), 2))
  1041.                 G.DrawPath(Pens.Black, d.RoundRect(checkBoxRectangle, 2))
  1042.             Case True
  1043.                 Dim g1 As New LinearGradientBrush(checkBoxRectangle, Color.FromArgb(10, 10, 10), Color.FromArgb(16, 16, 16), 90S)
  1044.                 G.FillPath(g1, d.RoundRect(checkBoxRectangle, 2))
  1045.                 Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  1046.                 G.FillPath(h1, d.RoundRect(New Rectangle(0, 0, Height - 1, Height - 2), 2))
  1047.                 Dim s1 As New LinearGradientBrush(New Rectangle(0, 0, Height - 1, Height / 2), Color.FromArgb(35, Color.White), Color.FromArgb(0, Color.White), 90S)
  1048.                 G.FillPath(s1, d.RoundRect(New Rectangle(0, 0, Height - 1, Height / 2 - 1), 2))
  1049.                 G.DrawPath(New Pen(Color.FromArgb(80, 97, 94, 90)), d.RoundRect(New Rectangle(1, 1, Height - 3, Height - 3), 2))
  1050.                 G.DrawPath(Pens.Black, d.RoundRect(checkBoxRectangle, 2))
  1051.  
  1052.                 Dim chkPoly As Rectangle = New Rectangle(checkBoxRectangle.X + checkBoxRectangle.Width / 4, checkBoxRectangle.Y + checkBoxRectangle.Height / 4, checkBoxRectangle.Width \ 2, checkBoxRectangle.Height \ 2)
  1053.                 Dim Poly() As Point = {New Point(chkPoly.X, chkPoly.Y + chkPoly.Height \ 2), _
  1054.                                New Point(chkPoly.X + chkPoly.Width \ 2, chkPoly.Y + chkPoly.Height), _
  1055.                                New Point(chkPoly.X + chkPoly.Width, chkPoly.Y)}
  1056.                 If Checked Then
  1057.                     G.SmoothingMode = SmoothingMode.HighQuality
  1058.                     Dim P1 As New Pen(Color.FromArgb(250, 255, 255, 255), 2)
  1059.                     For i = 0 To Poly.Length - 2
  1060.                         G.DrawLine(P1, Poly(i), Poly(i + 1))
  1061.                     Next
  1062.                 End If
  1063.  
  1064.         End Select
  1065.  
  1066.         G.DrawString(Text, Font, New SolidBrush(ForeColor), New Point(16, 1), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Near})
  1067.  
  1068.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  1069.         G.Dispose() : B.Dispose()
  1070.  
  1071.     End Sub
  1072.  
  1073. End Class
  1074.  
  1075. <DefaultEvent("CheckedChanged")> Public Class InfluenceRadioButton : Inherits Control
  1076.  
  1077. #Region " Control Help - MouseState & Flicker Control"
  1078.     Private R1 As Rectangle
  1079.     Private G1 As LinearGradientBrush
  1080.  
  1081.     Private State As MouseState = MouseState.None
  1082.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  1083.         MyBase.OnMouseEnter(e)
  1084.         State = MouseState.Over
  1085.         Invalidate()
  1086.     End Sub
  1087.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  1088.         MyBase.OnMouseDown(e)
  1089.         State = MouseState.Down
  1090.         Invalidate()
  1091.     End Sub
  1092.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  1093.         MyBase.OnMouseLeave(e)
  1094.         State = MouseState.None
  1095.         Invalidate()
  1096.     End Sub
  1097.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  1098.         MyBase.OnMouseUp(e)
  1099.         State = MouseState.Over
  1100.         Invalidate()
  1101.     End Sub
  1102.     Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  1103.         MyBase.OnResize(e)
  1104.         Height = 16
  1105.     End Sub
  1106.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  1107.         MyBase.OnTextChanged(e)
  1108.         Invalidate()
  1109.     End Sub
  1110.     Private _Checked As Boolean
  1111.     Property Checked() As Boolean
  1112.         Get
  1113.             Return _Checked
  1114.         End Get
  1115.         Set(ByVal value As Boolean)
  1116.             _Checked = value
  1117.             InvalidateControls()
  1118.             RaiseEvent CheckedChanged(Me)
  1119.             Invalidate()
  1120.         End Set
  1121.     End Property
  1122.     Protected Overrides Sub OnClick(ByVal e As EventArgs)
  1123.         If Not _Checked Then Checked = True
  1124.         MyBase.OnClick(e)
  1125.     End Sub
  1126.     Event CheckedChanged(ByVal sender As Object)
  1127.     Protected Overrides Sub OnCreateControl()
  1128.         MyBase.OnCreateControl()
  1129.         InvalidateControls()
  1130.     End Sub
  1131.     Private Sub InvalidateControls()
  1132.         If Not IsHandleCreated OrElse Not _Checked Then Return
  1133.  
  1134.         For Each C As Control In Parent.Controls
  1135.             If C IsNot Me AndAlso TypeOf C Is InfluenceRadioButton Then
  1136.                 DirectCast(C, InfluenceRadioButton).Checked = False
  1137.             End If
  1138.         Next
  1139.     End Sub
  1140. #End Region
  1141.  
  1142.     Sub New()
  1143.         MyBase.New()
  1144.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  1145.         BackColor = Color.Transparent
  1146.         ForeColor = Color.White
  1147.         Size = New Size(150, 16)
  1148.         DoubleBuffered = True
  1149.     End Sub
  1150.  
  1151.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  1152.         Dim B As New Bitmap(Width, Height)
  1153.         Dim G As Graphics = Graphics.FromImage(B)
  1154.         Dim d As New Draw()
  1155.         Dim radioBtnRectangle = New Rectangle(0, 0, Height - 1, Height - 1)
  1156.  
  1157.         G.SmoothingMode = SmoothingMode.HighQuality
  1158.         G.Clear(BackColor)
  1159.  
  1160.         Select Case Checked
  1161.             Case False
  1162.                 Dim g1 As New LinearGradientBrush(radioBtnRectangle, Color.FromArgb(10, 10, 10), Color.FromArgb(16, 16, 16), 90S)
  1163.                 G.FillEllipse(g1, radioBtnRectangle)
  1164.                 G.DrawEllipse(New Pen(Color.FromArgb(80, 97, 94, 90)), New Rectangle(1, 1, Height - 3, Height - 3))
  1165.                 G.DrawEllipse(Pens.Black, radioBtnRectangle)
  1166.             Case True
  1167.                 Dim g1 As New LinearGradientBrush(radioBtnRectangle, Color.FromArgb(10, 10, 10), Color.FromArgb(16, 16, 16), 90S)
  1168.                 G.FillEllipse(g1, radioBtnRectangle)
  1169.                 Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  1170.                 G.FillEllipse(h1, radioBtnRectangle)
  1171.                 Dim s1 As New LinearGradientBrush(New Rectangle(0, 1, Height - 1, Height / 2 - 1), Color.FromArgb(35, Color.White), Color.FromArgb(0, Color.White), 90S)
  1172.                 G.FillEllipse(s1, s1.Rectangle)
  1173.  
  1174.                 G.FillEllipse(New SolidBrush(Color.FromArgb(15, 15, 15)), New Rectangle(4, 4, Height - 9, Height - 9))
  1175.                 G.FillEllipse(New SolidBrush(Color.FromArgb(250, 255, 255, 255)), New Rectangle(5, 5, Height - 11, Height - 11))
  1176.  
  1177.                 G.DrawEllipse(New Pen(Color.FromArgb(80, 97, 94, 90)), New Rectangle(1, 1, Height - 3, Height - 3))
  1178.                 G.DrawEllipse(Pens.Black, radioBtnRectangle)
  1179.         End Select
  1180.  
  1181.         G.DrawString(Text, Font, Brushes.White, New Point(16, 0), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Near})
  1182.  
  1183.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  1184.         G.Dispose() : B.Dispose()
  1185.     End Sub
  1186.  
  1187. End Class
  1188.  
  1189. Public Class InfluenceGroupBox : Inherits ContainerControl
  1190. #Region " Control Help - Properties & Flicker Control"
  1191.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  1192.         MyBase.OnTextChanged(e)
  1193.         Invalidate()
  1194.     End Sub
  1195. #End Region
  1196.  
  1197.     Sub New()
  1198.         MyBase.New()
  1199.         Size = New Size(200, 100)
  1200.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  1201.         BackColor = Color.Transparent
  1202.         DoubleBuffered = True
  1203.     End Sub
  1204.  
  1205.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  1206.         Dim B As New Bitmap(Width, Height)
  1207.         Dim G As Graphics = Graphics.FromImage(B)
  1208.  
  1209.         G.SmoothingMode = SmoothingMode.HighSpeed
  1210.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  1211.         Dim TransparencyKey As Color = Me.ParentForm.TransparencyKey
  1212.         Dim d As New Draw()
  1213.         MyBase.OnPaint(e)
  1214.  
  1215.         G.Clear(BackColor)
  1216.  
  1217.         G.FillPath(New SolidBrush(Color.FromArgb(20, 20, 20)), d.RoundRect(ClientRectangle, 2))
  1218.  
  1219.  
  1220.         Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  1221.         Dim g1 As New LinearGradientBrush(New Rectangle(0, 2, Width - 1, 25), Color.FromArgb(40, 40, 40), Color.FromArgb(29, 29, 29), 90S)
  1222.  
  1223.         G.FillPath(g1, d.RoundRect(New Rectangle(0, 2, Width - 1, 25), 2))
  1224.         G.FillPath(h1, d.RoundRect(New Rectangle(0, 2, Width - 1, 25), 2))
  1225.  
  1226.         Dim s1 As New LinearGradientBrush(g1.Rectangle, Color.FromArgb(15, Color.White), Color.FromArgb(0, Color.White), 90S)
  1227.         G.FillRectangle(s1, New Rectangle(1, 1, Width - 1, 13))
  1228.  
  1229.         G.DrawLine(New Pen(Color.FromArgb(75, Color.White)), 1, 1, Width - 1, 1)
  1230.  
  1231.         G.DrawLine(New Pen(Color.FromArgb(18, 18, 18)), 1, 26, Width - 1, 26)
  1232.  
  1233.         G.DrawRectangle(New Pen(Color.FromArgb(37, 37, 37)), New Rectangle(1, 27, Width - 3, Height - 29))
  1234.  
  1235.         G.DrawPath(Pens.Black, d.RoundRect(ClientRectangle, 2))
  1236.  
  1237.         G.DrawString(Text, Font, Brushes.Black, New Rectangle(8, 8, Width - 1, 10), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Near})
  1238.         G.DrawString(Text, Font, Brushes.White, New Rectangle(8, 9, Width - 1, 11), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Near})
  1239.  
  1240.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  1241.         G.Dispose() : B.Dispose()
  1242.     End Sub
  1243. End Class
  1244.  
  1245. Public Class InfluenceNumericUpDown : Inherits Control
  1246.  
  1247. #Region " Properties & Flicker Control "
  1248.     Private State As New MouseState
  1249.     Private X As Integer
  1250.     Private Y As Integer
  1251.     Private _Value As Long
  1252.     Private _Max As Long
  1253.     Private _Min As Long
  1254.     Private Typing As Boolean
  1255.     Public Property Value As Long
  1256.         Get
  1257.             Return _Value
  1258.         End Get
  1259.         Set(ByVal V As Long)
  1260.             If V <= _Max And V >= _Min Then _Value = V
  1261.             Invalidate()
  1262.         End Set
  1263.     End Property
  1264.     Public Property Maximum As Long
  1265.         Get
  1266.             Return _Max
  1267.         End Get
  1268.         Set(ByVal V As Long)
  1269.             If V > _Min Then _Max = V
  1270.             If _Value > _Max Then _Value = _Max
  1271.             Invalidate()
  1272.         End Set
  1273.     End Property
  1274.     Public Property Minimum As Long
  1275.         Get
  1276.             Return _Min
  1277.         End Get
  1278.         Set(ByVal V As Long)
  1279.             If V < _Max Then _Min = V
  1280.             If _Value < _Min Then _Value = _Min
  1281.             Invalidate()
  1282.         End Set
  1283.     End Property
  1284.     Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)
  1285.         MyBase.OnMouseMove(e)
  1286.         X = e.Location.X
  1287.         Y = e.Location.Y
  1288.         Invalidate()
  1289.         If e.X < Width - 23 Then Cursor = Cursors.IBeam Else Cursor = Cursors.Default
  1290.     End Sub
  1291.     Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  1292.         MyBase.OnResize(e)
  1293.         Me.Height = 22
  1294.     End Sub
  1295.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  1296.         MyBase.OnMouseClick(e)
  1297.         If X > Me.Width - 21 Then
  1298.             If Y < 10 Then
  1299.                 If (Value + 1) <= _Max Then _Value += 1
  1300.             Else
  1301.                 If (Value - 1) >= _Min Then _Value -= 1
  1302.             End If
  1303.         Else
  1304.             Typing = Not Typing
  1305.             Focus()
  1306.         End If
  1307.         Invalidate()
  1308.     End Sub
  1309.     Protected Overrides Sub OnKeyPress(ByVal e As System.Windows.Forms.KeyPressEventArgs)
  1310.         MyBase.OnKeyPress(e)
  1311.         Try
  1312.             If Typing Then _Value = CStr(CStr(_Value) & e.KeyChar.ToString)
  1313.         Catch ex As Exception : End Try
  1314.     End Sub
  1315.     Protected Overrides Sub OnKeyup(ByVal e As System.Windows.Forms.KeyEventArgs)
  1316.         MyBase.OnKeyUp(e)
  1317.         If e.KeyCode = Keys.Up Then
  1318.             If (Value + 1) <= _Max Then _Value += 1
  1319.             Invalidate()
  1320.         ElseIf e.KeyCode = Keys.Down Then
  1321.             If (Value - 1) >= _Min Then _Value -= 1
  1322.         End If
  1323.         Invalidate()
  1324.     End Sub
  1325.     Protected Sub DrawTriangle(ByVal Clr As Color, ByVal FirstPoint As Point, ByVal SecondPoint As Point, ByVal ThirdPoint As Point, ByVal G As Graphics)
  1326.         Dim points As New List(Of Point)()
  1327.         points.Add(FirstPoint)
  1328.         points.Add(SecondPoint)
  1329.         points.Add(ThirdPoint)
  1330.         G.FillPolygon(New SolidBrush(Clr), points.ToArray)
  1331.     End Sub
  1332. #End Region
  1333.  
  1334.     Sub New()
  1335.         _Max = 9999999
  1336.         _Min = 0
  1337.         Cursor = Cursors.IBeam
  1338.         SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  1339.         BackColor = Color.Transparent
  1340.         DoubleBuffered = True
  1341.     End Sub
  1342.  
  1343.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  1344.         Dim B As New Bitmap(Width, Height)
  1345.         Dim G As Graphics = Graphics.FromImage(B)
  1346.  
  1347.         G.Clear(BackColor)
  1348.  
  1349.         Dim d As New Draw()
  1350.         G.SmoothingMode = SmoothingMode.HighQuality
  1351.         G.Clear(Color.FromArgb(20, 20, 20))
  1352.  
  1353.         Dim g1 As New LinearGradientBrush(ClientRectangle, Color.FromArgb(125, 78, 75, 73), Color.FromArgb(125, 61, 59, 55), 90S)
  1354.         G.FillPath(g1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), 2))
  1355.         Dim h1 As New HatchBrush(HatchStyle.DarkUpwardDiagonal, Color.FromArgb(100, 31, 31, 31), Color.FromArgb(100, 36, 36, 36))
  1356.         G.FillPath(h1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), 2))
  1357.         Dim s1 As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2), Color.FromArgb(35, Color.White), Color.FromArgb(0, Color.White), 90S)
  1358.         G.FillPath(s1, d.RoundRect(New Rectangle(0, 0, Width - 1, Height / 2 - 1), 2))
  1359.         G.DrawPath(New Pen(Color.FromArgb(150, 97, 94, 90)), d.RoundRect(New Rectangle(0, 1, Width - 1, Height - 3), 2))
  1360.         G.DrawPath(New Pen(Color.FromArgb(0, 0, 0)), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 2))
  1361.  
  1362.         ''Separator Lines
  1363.         G.DrawLine(New Pen(Color.FromArgb(10, 10, 10)), New Point(Width - 21, 0), New Point(Width - 21, Height))
  1364.         G.DrawLine(New Pen(Color.FromArgb(70, 70, 70)), New Point(Width - 20, 1), New Point(Width - 20, Height - 3))
  1365.         G.DrawLine(New Pen(Color.FromArgb(10, 10, 10)), New Point(Width - 20, 10), New Point(Width, 10))
  1366.         G.DrawLine(New Pen(Color.FromArgb(70, 70, 70)), New Point(Width - 19, 11), New Point(Width - 3, 11))
  1367.  
  1368.         'Top Triangle
  1369.         DrawTriangle(Color.White, New Point(Width - 14, 14), New Point(Width - 7, 14), New Point(Width - 11, 17.5), G)
  1370.  
  1371.         'Bottom Triangle
  1372.         DrawTriangle(Color.White, New Point(Width - 14, 7), New Point(Width - 7, 7), New Point(Width - 11, 3), G)
  1373.  
  1374.         G.DrawString(Value, Font, Brushes.White, New Point(5, 4))
  1375.         'G.DrawRectangle(New Pen(Color.FromArgb(70, 70, 70)), New Rectangle(1, 1, Width - 3, Height - 3))
  1376.         'G.DrawRectangle(New Pen(Color.FromArgb(30, 30, 30)), New Rectangle(0, 0, Width - 1, Height - 1))
  1377.  
  1378.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  1379.         G.Dispose() : B.Dispose()
  1380.     End Sub
  1381.  
  1382. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement