Advertisement
Finessed

Blackshades Theme

Dec 4th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 38.53 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. ' Get more free themes at ThemesVB.NET
  5.  
  6. Enum MouseState As Byte
  7.     None = 0
  8.     Over = 1
  9.     Down = 2
  10.     Block = 3
  11. End Enum
  12.  
  13. #Region " GLOBAL FUNCTIONS "
  14.  
  15. Class Draw
  16.     Public Function RoundRect(ByVal Rectangle As Rectangle, ByVal Curve As Integer) As GraphicsPath
  17.         Dim P As GraphicsPath = New GraphicsPath()
  18.         Dim ArcRectangleWidth As Integer = Curve * 2
  19.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  20.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  21.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  22.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  23.         P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
  24.         Return P
  25.     End Function
  26.     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
  27.         Dim Rectangle As Rectangle = New Rectangle(X, Y, Width, Height)
  28.         Dim P As GraphicsPath = New GraphicsPath()
  29.         Dim ArcRectangleWidth As Integer = Curve * 2
  30.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  31.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  32.         P.AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  33.         P.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  34.         P.AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
  35.         Return P
  36.     End Function
  37. End Class
  38.  
  39. #End Region
  40.  
  41.  ' Get more free themes at ThemesVB.NET
  42. Public Class BlackShadesNetForm : Inherits ContainerControl
  43.  
  44. #Region " Control Help - Movement & Flicker Control "
  45.     Private MouseP As Point = New Point(0, 0)
  46.     Private Cap As Boolean = False
  47.     Private MoveHeight As Integer
  48.     Private pos As Integer = 0
  49.  
  50.     Private Sub minimBtnClick() Handles minimBtn.Click
  51.         ParentForm.FindForm.WindowState = FormWindowState.Minimized
  52.     End Sub
  53.     Private Sub closeBtnClick() Handles closeBtn.Click
  54.         If CloseButtonExitsApp Then
  55.             System.Environment.Exit(0)
  56.         Else
  57.             ParentForm.FindForm.Close()
  58.         End If
  59.     End Sub
  60.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  61.         MyBase.OnMouseDown(e)
  62.         If e.Button = Windows.Forms.MouseButtons.Left And New Rectangle(0, 0, Width, MoveHeight).Contains(e.Location) Then
  63.             Cap = True : MouseP = e.Location
  64.         End If
  65.     End Sub
  66.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  67.         MyBase.OnMouseUp(e) : Cap = False
  68.     End Sub
  69.     Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)
  70.         MyBase.OnMouseMove(e)
  71.         If Cap Then
  72.             Parent.Location = MousePosition - MouseP
  73.         End If
  74.     End Sub
  75.     Protected Overrides Sub OnInvalidated(ByVal e As System.Windows.Forms.InvalidateEventArgs)
  76.         MyBase.OnInvalidated(e)
  77.         ParentForm.FindForm.Text = Text
  78.     End Sub
  79.     Protected Overrides Sub OnPaintBackground(ByVal e As System.Windows.Forms.PaintEventArgs)
  80.     End Sub
  81.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  82.         MyBase.OnTextChanged(e)
  83.         Invalidate()
  84.     End Sub
  85.     Protected Overrides Sub OnCreateControl()
  86.         MyBase.OnCreateControl()
  87.         Me.ParentForm.FormBorderStyle = FormBorderStyle.None
  88.         Me.ParentForm.TransparencyKey = Color.Fuchsia
  89.     End Sub
  90.     Protected Overrides Sub CreateHandle()
  91.         MyBase.CreateHandle()
  92.     End Sub
  93.     Private _closesEnv As Boolean = False
  94.     Public Property CloseButtonExitsApp() As Boolean
  95.         Get
  96.             Return _closesEnv
  97.         End Get
  98.         Set(ByVal v As Boolean)
  99.             _closesEnv = v
  100.             Invalidate()
  101.         End Set
  102.     End Property
  103.  
  104.     Private _minimBool As Boolean = True
  105.     Public Property MinimizeButton() As Boolean
  106.         Get
  107.             Return _minimBool
  108.         End Get
  109.         Set(ByVal v As Boolean)
  110.             _minimBool = v
  111.             Invalidate()
  112.         End Set
  113.     End Property
  114.  
  115. #End Region
  116.  ' Get more free themes at ThemesVB.NET
  117.     Dim WithEvents minimBtn As New BlackShadesNetTopButton With {.Location = New Point(Width - 44, 7)}
  118.     Dim WithEvents closeBtn As New BlackShadesNetTopButton With {.Location = New Point(Width - 27, 7)}
  119.  
  120.     Sub New()
  121.         MyBase.New()
  122.         Dock = DockStyle.Fill
  123.         MoveHeight = 25
  124.         Font = New Font("Trebuchet MS", 8.25F, FontStyle.Bold)
  125.         ForeColor = Color.FromArgb(142, 152, 156)
  126.         DoubleBuffered = True
  127.  
  128.         Controls.Add(closeBtn)
  129.  
  130.         closeBtn.Refresh() : minimBtn.Refresh()
  131.     End Sub
  132.  
  133.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  134.  
  135.         Const curve As Integer = 7
  136.         Dim B As New Bitmap(Width, Height)
  137.         Dim G As Graphics = Graphics.FromImage(B)
  138.  
  139.         If _minimBool Then
  140.             Controls.Add(minimBtn)
  141.         Else
  142.             Controls.Remove(minimBtn)
  143.         End If
  144.  
  145.         minimBtn.Location = New Point(Width - 44, 7)
  146.         closeBtn.Location = New Point(Width - 27, 7)
  147.  
  148.         G.SmoothingMode = SmoothingMode.Default
  149.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  150.         Dim TransparencyKey As Color = Me.ParentForm.TransparencyKey
  151.         Dim d As New Draw()
  152.         MyBase.OnPaint(e)
  153.  
  154.         G.Clear(TransparencyKey)
  155.  
  156.         G.FillPath(New SolidBrush(Color.FromArgb(42, 47, 49)), d.RoundRect(ClientRectangle, curve))
  157.  
  158.  
  159.         'DRAW GRADIENTED BORDER
  160.         Dim innerGradLeft As New LinearGradientBrush(New Rectangle(1, 1, Width / 2 - 1, Height - 3), _
  161.                                              Color.FromArgb(102, 108, 112), Color.FromArgb(204, 216, 224), 0S)
  162.         Dim innerGradRight As New LinearGradientBrush(New Rectangle(1, 1, Width / 2 - 1, Height - 3), _
  163.                                      Color.FromArgb(204, 216, 224), Color.FromArgb(102, 108, 112), 0S)
  164.         G.DrawPath(New Pen(innerGradLeft), d.RoundRect(New Rectangle(1, 1, Width / 2 + 3, Height - 3), curve))
  165.         G.DrawPath(New Pen(innerGradRight), d.RoundRect(New Rectangle(Width / 2 - 5, 1, Width / 2 + 3, Height - 3), curve))
  166.  
  167.  
  168.         G.FillPath(New SolidBrush(Color.FromArgb(42, 47, 49)), d.RoundRect(New Rectangle(2, 2, Width - 5, Height - 5), curve))
  169.  
  170.  
  171.         Dim topGradLeft As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, 25), Color.FromArgb(42, 46, 48), _
  172.                                                    Color.FromArgb(93, 98, 101), 0S)
  173.         Dim topGradRight As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, 25), Color.FromArgb(93, 98, 101), _
  174.                                            Color.FromArgb(42, 46, 48), 0S)
  175.         G.FillPath(topGradLeft, d.RoundRect(New Rectangle(2, 2, Width / 2 + 2, 25), curve))
  176.         G.FillPath(topGradRight, d.RoundRect(New Rectangle(Width / 2 - 3, 2, Width / 2 - 1, 25), curve))
  177.  
  178.         G.FillRectangle(New SolidBrush(Color.FromArgb(42, 47, 49)), New Rectangle(2, 23, Width - 5, 10))
  179.  
  180.         G.DrawPath(New Pen(Color.FromArgb(42, 46, 48)), d.RoundRect(New Rectangle(2, 2, Width - 5, Height - 5), curve))
  181.         G.DrawPath(New Pen(Color.FromArgb(9, 11, 12)), d.RoundRect(ClientRectangle, curve))
  182.  
  183.         G.DrawString(Text, Font, Brushes.White, New Rectangle(curve, curve - 2, Width - 1, 22), New StringFormat() With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Near})
  184.  
  185.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  186.         G.Dispose() : B.Dispose()
  187.     End Sub
  188. End Class
  189.  ' Get more free themes at ThemesVB.NET
  190. Public Class BlackShadesNetButton : 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 OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  215.     End Sub
  216.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  217.         MyBase.OnTextChanged(e)
  218.         Invalidate()
  219.     End Sub
  220.     Private _align As StringAlignment = StringAlignment.Center
  221.     Public Shadows Property TextAlignment() As StringAlignment
  222.         Get
  223.             Return _align
  224.         End Get
  225.         Set(ByVal v As StringAlignment)
  226.             _align = v
  227.             Invalidate()
  228.         End Set
  229.     End Property
  230.  
  231. #End Region
  232.  
  233.     Sub New()
  234.         MyBase.New()
  235.         BackColor = Color.FromArgb(38, 38, 38)
  236.         Font = New Font("Trebuchet MS", 8.25F, FontStyle.Bold)
  237.         'ForeColor = Color.FromArgb(142, 152, 156)
  238.         ForeColor = Color.White
  239.         DoubleBuffered = True
  240.         Size = New Size(75, 23)
  241.     End Sub
  242.  
  243.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  244.         Dim B As New Bitmap(Width, Height)
  245.         Dim G As Graphics = Graphics.FromImage(B)
  246.  
  247.         Const curve As Integer = 3
  248.         Dim ClientRectangle = New Rectangle(0, 0, Width - 1, Height - 1)
  249.  
  250.         Dim d As New Draw()
  251.         G.SmoothingMode = SmoothingMode.HighQuality
  252.         'G.Clear(Color.FromArgb(20, 20, 20))
  253.         'Dim bg As Color = Parent.FindForm.BackColor
  254.         G.Clear(Color.FromArgb(42, 47, 49))
  255.  
  256.         Select Case State
  257.             Case MouseState.None 'Mouse None
  258.                 G.FillPath(New SolidBrush(Color.FromArgb(32, 36, 38)), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), curve))
  259.                 Dim gloss As New LinearGradientBrush(New Rectangle(1, 1, Width - 5, Height / 2 - 3), Color.FromArgb(70, Color.White), Color.Transparent, 90S)
  260.                 G.FillPath(gloss, d.RoundRect(New Rectangle(0, 0, Width - 1, Height / 2 - 3), curve))
  261.                 Dim borderRect As New LinearGradientBrush(ClientRectangle, Color.FromArgb(36, 31, 43), Color.FromArgb(61, 65, 68), 90S)
  262.                 G.DrawPath(New Pen(Color.FromArgb(99, 103, 105)), d.RoundRect(New Rectangle(0, 1, Width - 1, Height - 3), curve))
  263.                 G.DrawPath(New Pen(borderRect), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), curve))
  264.                 G.DrawPath(New Pen(Color.FromArgb(27, 31, 33)), d.RoundRect(New Rectangle(1, 0, Width - 3, Height - 3), curve))
  265.             Case MouseState.Over 'Mouse Hover
  266.                 G.FillPath(New SolidBrush(Color.FromArgb(32, 36, 38)), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), curve))
  267.                 Dim gloss As New LinearGradientBrush(New Rectangle(1, 1, Width - 5, Height / 2 - 3), Color.FromArgb(70, Color.White), Color.Transparent, 90S)
  268.                 G.FillPath(gloss, d.RoundRect(New Rectangle(0, 0, Width - 1, Height / 2 - 3), curve))
  269.                 Dim borderRect As New LinearGradientBrush(ClientRectangle, Color.FromArgb(36, 31, 43), Color.FromArgb(61, 65, 68), 90S)
  270.                 G.DrawPath(New Pen(Color.FromArgb(99, 103, 105)), d.RoundRect(New Rectangle(0, 1, Width - 1, Height - 3), curve))
  271.                 G.DrawPath(New Pen(Color.FromArgb(100, 99, 103, 105)), d.RoundRect(New Rectangle(2, 2, Width - 5, Height - 6), curve))
  272.                 G.DrawPath(New Pen(borderRect), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), curve))
  273.                 G.DrawPath(New Pen(Color.FromArgb(27, 31, 33)), d.RoundRect(New Rectangle(1, 0, Width - 3, Height - 3), curve))
  274.                 G.DrawPath(New Pen(Color.FromArgb(0, 186, 255)), d.RoundRect(New Rectangle(1, 1, Width - 3, Height - 4), curve))
  275.             Case MouseState.Down 'Mouse Down
  276.                 G.FillPath(New SolidBrush(Color.FromArgb(32, 36, 38)), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), curve))
  277.                 Dim topGrad As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2 - 1), Color.FromArgb(32, 36, 38), Color.FromArgb(57, 57, 57), 90S)
  278.                 G.FillPath(topGrad, d.RoundRect(New Rectangle(0, 0, Width - 1, Height / 2 + 1), curve))
  279.                 Dim botGrad As New LinearGradientBrush(New Rectangle(0, 0, Width - 1, Height / 2 - 1), Color.FromArgb(57, 57, 57), Color.FromArgb(32, 36, 38), 90S)
  280.                 G.FillPath(botGrad, d.RoundRect(New Rectangle(0, Height / 2 - 1, Width - 1, Height / 2 + 2), curve))
  281.                 G.DrawLine(New Pen(Color.FromArgb(57, 57, 57)), 0, Convert.ToInt32(Height / 2 - 1), Width - 1, Convert.ToInt32(Height / 2 - 1))
  282.  
  283.                 Dim borderRect As New LinearGradientBrush(ClientRectangle, Color.FromArgb(36, 31, 43), Color.FromArgb(61, 65, 68), 90S)
  284.                 G.DrawPath(New Pen(borderRect), d.RoundRect(New Rectangle(0, 0, Width - 1, Height - 2), curve))
  285.                 G.DrawPath(New Pen(Color.FromArgb(27, 31, 33)), d.RoundRect(New Rectangle(1, 0, Width - 3, Height - 3), curve))
  286.  
  287.         End Select
  288.  
  289.         'G.DrawRectangle(Pens.Black, ClientRectangle)
  290.  
  291.         'G.DrawString(Text, Font, Brushes.Black, New Rectangle(-1, -2, Width - 1, Height - 1), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  292.         G.DrawString(Text, Font, New SolidBrush(ForeColor), New Rectangle(-1, -1, Width - 1, Height - 1), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  293.  
  294.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  295.         G.Dispose() : B.Dispose()
  296.     End Sub
  297. End Class
  298.  
  299. Public Class BlackShadesNetTopButton : Inherits Control
  300. #Region " Control Help - MouseState & Flicker Control"
  301.  
  302.     Private State As MouseState = MouseState.None
  303.  
  304.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  305.         MyBase.OnMouseEnter(e)
  306.         State = MouseState.Over
  307.         Invalidate()
  308.     End Sub
  309.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  310.         MyBase.OnMouseDown(e)
  311.         State = MouseState.Down
  312.         Invalidate()
  313.     End Sub
  314.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  315.         MyBase.OnMouseLeave(e)
  316.         State = MouseState.None
  317.         Invalidate()
  318.     End Sub
  319.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  320.         MyBase.OnMouseUp(e)
  321.         State = MouseState.Over
  322.         Invalidate()
  323.     End Sub
  324.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  325.     End Sub
  326.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  327.         MyBase.OnTextChanged(e)
  328.         Invalidate()
  329.     End Sub
  330. #End Region
  331.  
  332.     Sub New()
  333.         MyBase.New()
  334.         BackColor = Color.FromArgb(38, 38, 38)
  335.         Font = New Font("Verdana", 8.25F)
  336.         Size = New Size(15, 11)
  337.         DoubleBuffered = True
  338.         Focus()
  339.     End Sub
  340.  
  341.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  342.         Dim B As New Bitmap(Width, Height)
  343.         Dim G As Graphics = Graphics.FromImage(B)
  344.         Dim d As New Draw()
  345.  
  346.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  347.  
  348.         Size = New Size(15, 11)
  349.         G.Clear(Color.FromArgb(49, 53, 55))
  350.  
  351.         Select Case State
  352.             Case MouseState.None 'Mouse None
  353.                 Dim border As New LinearGradientBrush(ClientRectangle, Color.FromArgb(200, 44, 47, 51), Color.FromArgb(80, 64, 69, 71), 90S)
  354.                 G.FillPath(border, d.RoundRect(ClientRectangle, 1))
  355.                 Dim bodyGrad As New LinearGradientBrush(New Rectangle(2, 2, Width - 6, Height - 6), Color.FromArgb(90, 97, 101), Color.FromArgb(63, 69, 73), 90S)
  356.                 G.FillPath(bodyGrad, d.RoundRect(New Rectangle(2, 2, Width - 6, Height - 6), 1))
  357.                 G.DrawPath(New Pen(Color.FromArgb(30, 32, 35)), d.RoundRect(New Rectangle(2, 2, Width - 6, Height - 6), 1))
  358.             Case MouseState.Over
  359.                 Dim border As New LinearGradientBrush(ClientRectangle, Color.FromArgb(200, 44, 47, 51), Color.FromArgb(80, 64, 69, 71), 90S)
  360.                 G.FillPath(border, d.RoundRect(ClientRectangle, 1))
  361.                 Dim bodyGrad As New LinearGradientBrush(New Rectangle(2, 2, Width - 6, Height - 6), Color.FromArgb(90, 97, 101), Color.FromArgb(63, 69, 73), 90S)
  362.                 G.FillPath(bodyGrad, d.RoundRect(New Rectangle(2, 2, Width - 6, Height - 6), 1))
  363.                 G.DrawPath(New Pen(Color.FromArgb(30, 32, 35)), d.RoundRect(New Rectangle(2, 2, Width - 6, Height - 6), 1))
  364.                 G.DrawPath(New Pen(Color.FromArgb(200, 0, 186, 255)), d.RoundRect(New Rectangle(2, 2, Width - 6, Height - 6), 1))
  365.             Case MouseState.Down
  366.                 Dim border As New LinearGradientBrush(ClientRectangle, Color.FromArgb(200, 44, 47, 51), Color.FromArgb(80, 64, 69, 71), 90S)
  367.                 G.FillPath(border, d.RoundRect(ClientRectangle, 1))
  368.                 Dim bodyGrad As New LinearGradientBrush(New Rectangle(2, 2, Width - 6, Height - 6), Color.FromArgb(90, 97, 101), Color.FromArgb(63, 69, 73), 135S)
  369.                 G.FillPath(bodyGrad, d.RoundRect(New Rectangle(2, 2, Width - 6, Height - 6), 1))
  370.                 G.DrawPath(New Pen(Color.FromArgb(30, 32, 35)), d.RoundRect(New Rectangle(2, 2, Width - 6, Height - 6), 1))
  371.         End Select
  372.  
  373.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  374.         G.Dispose() : B.Dispose()
  375.     End Sub
  376. End Class
  377.  
  378. Public Class BlackShadesNetMultiLineTextBox : Inherits Control
  379.     Dim WithEvents txtbox As New TextBox
  380.  
  381. #Region " Control Help - Properties & Flicker Control "
  382.     Private _maxchars As Integer = 32767
  383.     Public Property MaxCharacters() As Integer
  384.         Get
  385.             Return _maxchars
  386.         End Get
  387.         Set(ByVal v As Integer)
  388.             _maxchars = v
  389.             Invalidate()
  390.         End Set
  391.     End Property
  392.     Private _align As HorizontalAlignment
  393.     Public Shadows Property TextAlignment() As HorizontalAlignment
  394.         Get
  395.             Return _align
  396.         End Get
  397.         Set(ByVal v As HorizontalAlignment)
  398.             _align = v
  399.             Invalidate()
  400.         End Set
  401.     End Property
  402.  
  403.  
  404.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  405.     End Sub
  406.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  407.         MyBase.OnTextChanged(e)
  408.         Invalidate()
  409.     End Sub
  410.     Protected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)
  411.         MyBase.OnBackColorChanged(e)
  412.         txtbox.BackColor = BackColor
  413.         Invalidate()
  414.     End Sub
  415.     Protected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)
  416.         MyBase.OnForeColorChanged(e)
  417.         txtbox.ForeColor = ForeColor
  418.         Invalidate()
  419.     End Sub
  420.     Protected Overrides Sub OnSizeChanged(ByVal e As System.EventArgs)
  421.         MyBase.OnSizeChanged(e)
  422.         txtbox.Size = New Size(Width - 10, Height - 11)
  423.     End Sub
  424.     Protected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)
  425.         MyBase.OnFontChanged(e)
  426.         txtbox.Font = Font
  427.     End Sub
  428.     Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
  429.         MyBase.OnGotFocus(e)
  430.         txtbox.Focus()
  431.     End Sub
  432.     Sub TextChngTxtBox() Handles txtbox.TextChanged
  433.         Text = txtbox.Text
  434.     End Sub
  435.     Sub TextChng() Handles MyBase.TextChanged
  436.         txtbox.Text = Text
  437.     End Sub
  438.     Sub NewTextBox()
  439.         With txtbox
  440.             .Multiline = True
  441.             .BackColor = BackColor
  442.             .ForeColor = ForeColor
  443.             .Text = String.Empty
  444.             .TextAlign = HorizontalAlignment.Center
  445.             .BorderStyle = BorderStyle.None
  446.             .Location = New Point(3, 4)
  447.             .Font = New Font("Trebuchet MS", 8.25F, FontStyle.Bold)
  448.             .Size = New Size(Width - 10, Height - 10)
  449.         End With
  450.         txtbox.Font = New Font("Trebuchet MS", 8.25F, FontStyle.Bold)
  451.     End Sub
  452. #End Region
  453.  
  454.     Sub New()
  455.         MyBase.New()
  456.  
  457.         NewTextBox()
  458.         Controls.Add(txtbox)
  459.  
  460.         Text = ""
  461.         BackColor = Color.FromArgb(36, 40, 42)
  462.         ForeColor = Color.FromArgb(142, 152, 156)
  463.         Size = New Size(135, 35)
  464.         DoubleBuffered = True
  465.     End Sub
  466.  
  467.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  468.         Dim B As New Bitmap(Width, Height)
  469.         Dim G As Graphics = Graphics.FromImage(B)
  470.         G.SmoothingMode = SmoothingMode.HighQuality
  471.         Dim d As New Draw()
  472.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  473.  
  474.         txtbox.TextAlign = TextAlignment
  475.  
  476.         G.Clear(Color.FromArgb(36, 40, 42))
  477.  
  478.         G.FillRectangle(New SolidBrush(Color.FromArgb(36, 40, 42)), ClientRectangle)
  479.         G.DrawRectangle(New Pen(Color.FromArgb(53, 57, 60)), ClientRectangle)
  480.  
  481.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  482.         G.Dispose() : B.Dispose()
  483.     End Sub
  484. End Class
  485.  
  486. Public Class BlackShadesNetTextBox : Inherits Control
  487.     Dim WithEvents txtbox As New TextBox
  488.  
  489. #Region " Control Help - Properties & Flicker Control "
  490.     Private _passmask As Boolean = False
  491.     Public Shadows Property UseSystemPasswordChar() As Boolean
  492.         Get
  493.             Return _passmask
  494.         End Get
  495.         Set(ByVal v As Boolean)
  496.             txtbox.UseSystemPasswordChar = UseSystemPasswordChar
  497.             _passmask = v
  498.             Invalidate()
  499.         End Set
  500.     End Property
  501.     Private _maxchars As Integer = 32767
  502.     Public Shadows Property MaxLength() As Integer
  503.         Get
  504.             Return _maxchars
  505.         End Get
  506.         Set(ByVal v As Integer)
  507.             _maxchars = v
  508.             txtbox.MaxLength = MaxLength
  509.             Invalidate()
  510.         End Set
  511.     End Property
  512.     Private _align As HorizontalAlignment
  513.     Public Shadows Property TextAlignment() As HorizontalAlignment
  514.         Get
  515.             Return _align
  516.         End Get
  517.         Set(ByVal v As HorizontalAlignment)
  518.             _align = v
  519.             Invalidate()
  520.         End Set
  521.     End Property
  522.  
  523.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  524.     End Sub
  525.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  526.         MyBase.OnTextChanged(e)
  527.         Invalidate()
  528.     End Sub
  529.     Protected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)
  530.         MyBase.OnBackColorChanged(e)
  531.         txtbox.BackColor = BackColor
  532.         Invalidate()
  533.     End Sub
  534.     Protected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)
  535.         MyBase.OnForeColorChanged(e)
  536.         txtbox.ForeColor = ForeColor
  537.         Invalidate()
  538.     End Sub
  539.     Protected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)
  540.         MyBase.OnFontChanged(e)
  541.         txtbox.Font = Font
  542.     End Sub
  543.     Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
  544.         MyBase.OnGotFocus(e)
  545.         txtbox.Focus()
  546.     End Sub
  547.     Sub TextChngTxtBox() Handles txtbox.TextChanged
  548.         Text = txtbox.Text
  549.     End Sub
  550.     Sub TextChng() Handles MyBase.TextChanged
  551.         txtbox.Text = Text
  552.     End Sub
  553.     Sub NewTextBox()
  554.         With txtbox
  555.             .Multiline = False
  556.             .BackColor = Color.FromArgb(43, 43, 43)
  557.             .ForeColor = ForeColor
  558.             .Text = String.Empty
  559.             .TextAlign = HorizontalAlignment.Center
  560.             .BorderStyle = BorderStyle.None
  561.             .Location = New Point(5, 4)
  562.             .Font = New Font("Trebuchet MS", 8.25F, FontStyle.Bold)
  563.             .Size = New Size(Width - 10, Height - 11)
  564.             .UseSystemPasswordChar = UseSystemPasswordChar
  565.         End With
  566.  
  567.     End Sub
  568. #End Region
  569.  
  570.     Sub New()
  571.         MyBase.New()
  572.  
  573.         NewTextBox()
  574.         Controls.Add(txtbox)
  575.  
  576.         Text = ""
  577.         BackColor = Color.FromArgb(36, 40, 42)
  578.         ForeColor = Color.FromArgb(142, 152, 156)
  579.         Size = New Size(135, 35)
  580.         DoubleBuffered = True
  581.     End Sub
  582.  
  583.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  584.         Dim B As New Bitmap(Width, Height)
  585.         Dim G As Graphics = Graphics.FromImage(B)
  586.         G.SmoothingMode = SmoothingMode.HighQuality
  587.         Dim d As New Draw()
  588.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  589.  
  590.         Height = txtbox.Height + 11
  591.         With txtbox
  592.             .Width = Width - 10
  593.             .TextAlign = TextAlignment
  594.             .UseSystemPasswordChar = UseSystemPasswordChar
  595.         End With
  596.  
  597.         G.Clear(Color.FromArgb(36, 40, 42))
  598.  
  599.         G.FillRectangle(New SolidBrush(Color.FromArgb(36, 40, 42)), ClientRectangle)
  600.         G.DrawRectangle(New Pen(Color.FromArgb(53, 57, 60)), ClientRectangle)
  601.  
  602.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  603.         G.Dispose() : B.Dispose()
  604.     End Sub
  605. End Class
  606.  
  607. Public Class BlackShadesNetRichTextBox : Inherits Control
  608.     Dim WithEvents txtbox As New RichTextBox
  609.  
  610. #Region " Control Help - Properties & Flicker Control "
  611.  
  612.  ' Get more free themes at ThemesVB.NET
  613.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  614.     End Sub
  615.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  616.         MyBase.OnTextChanged(e)
  617.         Invalidate()
  618.     End Sub
  619.     Protected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)
  620.         MyBase.OnBackColorChanged(e)
  621.         txtbox.BackColor = BackColor
  622.         Invalidate()
  623.     End Sub
  624.     Protected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)
  625.         MyBase.OnForeColorChanged(e)
  626.         txtbox.ForeColor = ForeColor
  627.         Invalidate()
  628.     End Sub
  629.     Protected Overrides Sub OnSizeChanged(ByVal e As System.EventArgs)
  630.         MyBase.OnSizeChanged(e)
  631.         txtbox.Size = New Size(Width - 10, Height - 11)
  632.     End Sub
  633.     Protected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)
  634.         MyBase.OnFontChanged(e)
  635.         txtbox.Font = Font
  636.     End Sub
  637.     Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
  638.         MyBase.OnGotFocus(e)
  639.         txtbox.Focus()
  640.     End Sub
  641.     Sub TextChngTxtBox() Handles txtbox.TextChanged
  642.         Text = txtbox.Text
  643.     End Sub
  644.     Sub TextChng() Handles MyBase.TextChanged
  645.         txtbox.Text = Text
  646.     End Sub
  647.     Sub NewTextBox()
  648.         With txtbox
  649.             .Multiline = True
  650.             .BackColor = BackColor
  651.             .ForeColor = ForeColor
  652.             .Text = String.Empty
  653.             .BorderStyle = BorderStyle.None
  654.             .Location = New Point(3, 4)
  655.             .Font = New Font("Trebuchet MS", 8.25F, FontStyle.Bold)
  656.             .Size = New Size(Width - 10, Height - 10)
  657.         End With
  658.         txtbox.Font = New Font("Trebuchet MS", 8.25F, FontStyle.Bold)
  659.     End Sub
  660. #End Region
  661.  
  662.     Sub New()
  663.         MyBase.New()
  664.  
  665.         NewTextBox()
  666.         Controls.Add(txtbox)
  667.  
  668.         Text = ""
  669.         BackColor = Color.FromArgb(36, 40, 42)
  670.         ForeColor = Color.FromArgb(142, 152, 156)
  671.         Size = New Size(135, 35)
  672.         DoubleBuffered = True
  673.     End Sub
  674.  
  675.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  676.         Dim B As New Bitmap(Width, Height)
  677.         Dim G As Graphics = Graphics.FromImage(B)
  678.         G.SmoothingMode = SmoothingMode.HighQuality
  679.         Dim d As New Draw()
  680.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  681.  
  682.         G.Clear(Color.FromArgb(36, 40, 42))
  683.  
  684.         G.DrawRectangle(New Pen(Color.FromArgb(30, 33, 35), 2), ClientRectangle)
  685.         G.DrawLine(New Pen(Color.FromArgb(83, 90, 94)), Width - 1, 0, Width - 1, Height)
  686.         G.DrawLine(New Pen(Color.FromArgb(83, 90, 94)), 0, Height - 1, Width - 1, Height - 1)
  687.  
  688.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  689.         G.Dispose() : B.Dispose()
  690.     End Sub
  691. End Class
  692.  
  693. <DefaultEvent("CheckedChanged")> Public Class BlackShadesNetCheckBox : Inherits Control
  694.  
  695. #Region " Control Help - MouseState & Flicker Control"
  696.     Private State As MouseState = MouseState.None
  697.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  698.         MyBase.OnMouseEnter(e)
  699.         State = MouseState.Over
  700.         Invalidate()
  701.     End Sub
  702.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  703.         MyBase.OnMouseDown(e)
  704.         State = MouseState.Down
  705.         Invalidate()
  706.     End Sub
  707.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  708.         MyBase.OnMouseLeave(e)
  709.         State = MouseState.None
  710.         Invalidate()
  711.     End Sub
  712.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  713.         MyBase.OnMouseUp(e)
  714.         State = MouseState.Over
  715.         Invalidate()
  716.     End Sub
  717.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  718.     End Sub
  719.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  720.         MyBase.OnTextChanged(e)
  721.         Invalidate()
  722.     End Sub
  723.     Private _Checked As Boolean
  724.     Property Checked() As Boolean
  725.         Get
  726.             Return _Checked
  727.         End Get
  728.         Set(ByVal value As Boolean)
  729.             _Checked = value
  730.             Invalidate()
  731.         End Set
  732.     End Property
  733.     Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  734.         MyBase.OnResize(e)
  735.         Height = 14
  736.     End Sub
  737.     Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
  738.         _Checked = Not _Checked
  739.         RaiseEvent CheckedChanged(Me)
  740.         MyBase.OnClick(e)
  741.     End Sub
  742.     Event CheckedChanged(ByVal sender As Object)
  743. #End Region
  744.  
  745.     Sub New()
  746.         MyBase.New()
  747.         BackColor = Color.FromArgb(20, 20, 20)
  748.         ForeColor = Color.White
  749.         Size = New Size(145, 16)
  750.     End Sub
  751.  
  752.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  753.         Dim B As New Bitmap(Width, Height)
  754.         Dim G As Graphics = Graphics.FromImage(B)
  755.         Dim d As New Draw()
  756.  
  757.         Dim checkBoxRectangle As New Rectangle(0, 0, Height - 1, Height - 1)
  758.  
  759.         G.Clear(Color.FromArgb(42, 47, 49))
  760.  
  761.         Dim bodyGrad As New LinearGradientBrush(checkBoxRectangle, Color.FromArgb(36, 40, 42), Color.FromArgb(64, 71, 74), 90S)
  762.         G.FillRectangle(bodyGrad, bodyGrad.Rectangle)
  763.         G.DrawRectangle(New Pen(Color.FromArgb(42, 47, 49)), New Rectangle(1, 1, Height - 3, Height - 3))
  764.         G.DrawRectangle(New Pen(Color.FromArgb(102, 108, 112)), checkBoxRectangle)
  765.  
  766.  
  767.         If Checked Then
  768.             Dim chkPoly As Rectangle = New Rectangle(checkBoxRectangle.X + checkBoxRectangle.Width / 4, checkBoxRectangle.Y + checkBoxRectangle.Height / 4, checkBoxRectangle.Width \ 2, checkBoxRectangle.Height \ 2)
  769.             Dim Poly() As Point = {New Point(chkPoly.X, chkPoly.Y + chkPoly.Height \ 2), _
  770.                            New Point(chkPoly.X + chkPoly.Width \ 2, chkPoly.Y + chkPoly.Height), _
  771.                            New Point(chkPoly.X + chkPoly.Width, chkPoly.Y)}
  772.             G.SmoothingMode = SmoothingMode.HighQuality
  773.             Dim P1 As New Pen(Color.FromArgb(250, 255, 255, 255), 2)
  774.             Dim chkGrad As New LinearGradientBrush(chkPoly, Color.FromArgb(200, 200, 200), Color.FromArgb(255, 255, 255), 0S)
  775.             For i = 0 To Poly.Length - 2
  776.                 G.DrawLine(P1, Poly(i), Poly(i + 1))
  777.             Next
  778.         End If
  779.         G.DrawString(Text, Font, New SolidBrush(ForeColor), New Point(18, -1), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Near})
  780.  
  781.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  782.         G.Dispose() : B.Dispose()
  783.  
  784.     End Sub
  785.  
  786. End Class
  787.  
  788. <DefaultEvent("CheckedChanged")> Public Class BlackShadesNetRadioButton : Inherits Control
  789.  
  790. #Region " Control Help - MouseState & Flicker Control"
  791.     Private R1 As Rectangle
  792.     Private G1 As LinearGradientBrush
  793.  
  794.     Private State As MouseState = MouseState.None
  795.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  796.         MyBase.OnMouseEnter(e)
  797.         State = MouseState.Over
  798.         Invalidate()
  799.     End Sub
  800.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  801.         MyBase.OnMouseDown(e)
  802.         State = MouseState.Down
  803.         Invalidate()
  804.     End Sub
  805.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  806.         MyBase.OnMouseLeave(e)
  807.         State = MouseState.None
  808.         Invalidate()
  809.     End Sub
  810.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  811.         MyBase.OnMouseUp(e)
  812.         State = MouseState.Over
  813.         Invalidate()
  814.     End Sub
  815.     Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  816.         MyBase.OnResize(e)
  817.         Height = 16
  818.     End Sub
  819.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  820.     End Sub
  821.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  822.         MyBase.OnTextChanged(e)
  823.         Invalidate()
  824.     End Sub
  825.     Private _Checked As Boolean
  826.     Property Checked() As Boolean
  827.         Get
  828.             Return _Checked
  829.         End Get
  830.         Set(ByVal value As Boolean)
  831.             _Checked = value
  832.             InvalidateControls()
  833.             RaiseEvent CheckedChanged(Me)
  834.             Invalidate()
  835.         End Set
  836.     End Property
  837.     Protected Overrides Sub OnClick(ByVal e As EventArgs)
  838.         If Not _Checked Then Checked = True
  839.         MyBase.OnClick(e)
  840.     End Sub
  841.     Event CheckedChanged(ByVal sender As Object)
  842.     Protected Overrides Sub OnCreateControl()
  843.         MyBase.OnCreateControl()
  844.         InvalidateControls()
  845.     End Sub
  846.     Private Sub InvalidateControls()
  847.         If Not IsHandleCreated OrElse Not _Checked Then Return
  848.  
  849.         For Each C As Control In Parent.Controls
  850.             If C IsNot Me AndAlso TypeOf C Is BlackShadesNetRadioButton Then
  851.                 DirectCast(C, BlackShadesNetRadioButton).Checked = False
  852.             End If
  853.         Next
  854.     End Sub
  855. #End Region
  856.  
  857.     Sub New()
  858.         MyBase.New()
  859.         BackColor = Color.FromArgb(42, 47, 49)
  860.         ForeColor = Color.White
  861.         Size = New Size(150, 16)
  862.     End Sub
  863.  ' Get more free themes at ThemesVB.NET
  864.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  865.         Dim B As New Bitmap(Width, Height)
  866.         Dim G As Graphics = Graphics.FromImage(B)
  867.         Dim d As New Draw()
  868.         Dim radioBtnRectangle = New Rectangle(0, 0, Height - 1, Height - 1)
  869.  
  870.         G.SmoothingMode = SmoothingMode.HighQuality
  871.         G.Clear(BackColor)
  872.  
  873.         Dim bgGrad As New LinearGradientBrush(radioBtnRectangle, Color.FromArgb(36, 40, 42), Color.FromArgb(66, 70, 72), 90S)
  874.         G.FillEllipse(bgGrad, radioBtnRectangle)
  875.  
  876.         G.DrawEllipse(New Pen(Color.FromArgb(44, 48, 50)), New Rectangle(1, 1, Height - 3, Height - 3))
  877.         G.DrawEllipse(New Pen(Color.FromArgb(102, 108, 112)), radioBtnRectangle)
  878.  
  879.         If Checked Then
  880.             Dim chkGrad As New LinearGradientBrush(New Rectangle(4, 4, Height - 9, Height - 8), Color.White, Color.Black, 90S)
  881.             G.FillEllipse(chkGrad, New Rectangle(4, 4, Height - 9, Height - 9))
  882.         End If
  883.  
  884.         G.DrawString(Text, Font, Brushes.White, New Point(18, 0), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Near})
  885.  
  886.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  887.         G.Dispose() : B.Dispose()
  888.     End Sub
  889.  
  890. End Class
  891.  
  892. Public Class BlackShadesNetGroupBox : Inherits ContainerControl
  893. #Region " Control Help - Properties & Flicker Control"
  894.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  895.     End Sub
  896.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  897.         MyBase.OnTextChanged(e)
  898.         Invalidate()
  899.     End Sub
  900. #End Region
  901.  
  902.     Sub New()
  903.         MyBase.New()
  904.         BackColor = Color.FromArgb(33, 33, 33)
  905.         Size = New Size(200, 100)
  906.     End Sub
  907.  ' Get more free themes at ThemesVB.NET
  908.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  909.         Dim B As New Bitmap(Width, Height)
  910.         Dim G As Graphics = Graphics.FromImage(B)
  911.  
  912.         G.SmoothingMode = SmoothingMode.HighSpeed
  913.         Const curve As Integer = 3
  914.         Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)
  915.         Dim TransparencyKey As Color = Me.ParentForm.TransparencyKey
  916.         Dim d As New Draw()
  917.         MyBase.OnPaint(e)
  918.  
  919.         G.Clear(Color.FromArgb(42, 47, 49))
  920.  
  921.  
  922.  
  923.         G.DrawPath(New Pen(Color.FromArgb(67, 75, 78)), d.RoundRect(New Rectangle(2, 7, Width - 5, Height - 9), curve))
  924.         Dim outerBorder As New LinearGradientBrush(ClientRectangle, Color.FromArgb(30, 32, 32), Color.Transparent, 90S)
  925.         G.DrawPath(New Pen(outerBorder), d.RoundRect(New Rectangle(1, 6, Width - 3, Height - 9), curve))
  926.         Dim innerBorder As New LinearGradientBrush(New Rectangle(3, 7, Width - 7, Height - 10), Color.Transparent, Color.FromArgb(30, 32, 32), 90S)
  927.         G.DrawPath(New Pen(innerBorder), d.RoundRect(New Rectangle(3, 7, Width - 7, Height - 10), curve))
  928.  
  929.         G.FillRectangle(New SolidBrush(Color.FromArgb(42, 47, 49)), New Rectangle(8, 0, Text.Length * 6, 11))
  930.  
  931.         G.DrawString(Text, Font, New SolidBrush(ForeColor), New Rectangle(8, 0, Width - 1, 11), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Near})
  932.  
  933.         e.Graphics.DrawImage(B.Clone(), 0, 0)
  934.         G.Dispose() : B.Dispose()
  935.     End Sub
  936. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement