skin untuk plugin di vb.net 2010

Download Skin untuk plugin di vb.net 2010

If you can't read please download the document

Upload: ariez-albaj

Post on 08-Nov-2015

16 views

Category:

Documents


11 download

DESCRIPTION

theme

TRANSCRIPT

skin[arioardi.blogspot.com].txtImports System.ComponentModel, System.Drawing, System.Drawing.Drawing2DEnum MouseState As ByteNone = 0Over = 1Down = 2Block = 3End EnumClass SharpButtonInherits Control#Region " Control Help - MouseState & Flicker Control"Private State As MouseState = MouseState.NoneProtected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)MyBase.OnMouseEnter(e)State = MouseState.OverInvalidate()End SubProtected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)MyBase.OnMouseDown(e)State = MouseState.DownInvalidate()End SubProtected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)MyBase.OnMouseLeave(e)State = MouseState.NoneInvalidate()End SubProtected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)MyBase.OnMouseUp(e)State = MouseState.OverInvalidate()End SubProtected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)MyBase.OnTextChanged(e)Invalidate()End Sub#End RegionPublic Property Color2() As BooleanGetReturn _Color2End GetSet(ByVal value As Boolean)_Color2 = valueMe.Refresh()End SetEnd PropertyPrivate _Color2 As Boolean = FalseSub New()MyBase.New()SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)ForeColor = Color.FromArgb(210, 220, 230)DoubleBuffered = TrueFont = New Font("Verdana", 8.5F, FontStyle.Regular)End SubProtected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)Dim bmp As New Bitmap(Width, Height)Dim G As Graphics = Graphics.FromImage(bmp)MyBase.OnPaint(e)Select Case StateCase MouseState.NoneIf _Color2 ThenG.Clear(Color.FromArgb(43, 53, 63))Dim BTNLGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Height / 2 - 2), Color.FromArgb(37, 47, 57), Color.FromArgb(140, 149, 155), 180)G.FillRectangle(BTNLGBOver, New Rectangle(2, 1, Width - 3, Height / 2 - 2))Dim BTNLGB1 As New LinearGradientBrush(New Rectangle(0, 1, Width - 2, Height / 2 - 2), Color.FromArgb(140, 149, 155), Color.FromArgb(37, 47, 57), 180)G.FillRectangle(BTNLGB1, New Rectangle(1, 1, Width / 2, Height / 2 - 2))G.SmoothingMode = SmoothingMode.HighQuality'----- Borders -----G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(23, 33, 43))), New Rectangle(0, 0, Width - 1, Height - 1))Dim InnerRect As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 2), Color.FromArgb(113, 123, 133), Color.FromArgb(50, 50, 50), 90)G.DrawRectangle(New Pen(InnerRect), New Rectangle(1, 1, Width - 3, Height - 3))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(63, 73, 83))), 2, Height - 2, Width - 2, Height - 2)G.DrawString(Text, Font, New SolidBrush(ForeColor), New Rectangle(0, -1, Width - 1, Height - 1), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})ElseG.Clear(Color.FromArgb(43, 53, 63))Dim BTNLGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Height / 2 - 2), Color.FromArgb(37, 47, 57), Color.FromArgb(140, 149, 155), LinearGradientMode.Horizontal)G.FillRectangle(BTNLGBOver, New Rectangle(2, 1, Width - 3, Height / 2 - 2))Dim BTNLGB1 As New LinearGradientBrush(New Rectangle(0, 1, Width - 2, Height / 2 - 2), Color.FromArgb(140, 149, 155), Color.FromArgb(37, 47, 57), LinearGradientMode.Horizontal)G.FillRectangle(BTNLGB1, New Rectangle(1, 1, Width / 2, Height / 2 - 2))G.SmoothingMode = SmoothingMode.HighQuality'----- Borders -----G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(33, 43, 53))), New Rectangle(0, 0, Width - 1, Height - 1))Dim InnerRect As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 2), Color.FromArgb(153, 163, 173), Color.FromArgb(50, 50, 50), 90)G.DrawRectangle(New Pen(InnerRect), New Rectangle(1, 1, Width - 3, Height - 3))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(73, 83, 93))), 1, Height - 2, Width - 2, Height - 2)G.DrawString(Text, Font, New SolidBrush(ForeColor), New Rectangle(0, -1, Width - 1, Height - 1), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})End IfCase MouseState.OverIf _Color2 ThenG.Clear(Color.FromArgb(47, 57, 67))Dim LGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Height / 2 - 2), Color.FromArgb(43, 53, 63), Color.FromArgb(157, 166, 172), 180)G.FillRectangle(LGBOver, New Rectangle(2, 1, Width - 3, Height / 2 - 2))Dim LGBOver1 As New LinearGradientBrush(New Rectangle(0, 1, Width - 2, Height / 2 - 2), Color.FromArgb(157, 166, 172), Color.FromArgb(43, 53, 63), 180)G.FillRectangle(LGBOver1, New Rectangle(1, 1, Width / 2, Height / 2 - 2))G.SmoothingMode = SmoothingMode.HighQuality'----- Borders -----G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(29, 39, 49))), New Rectangle(0, 0, Width - 1, Height - 1))Dim InnerRect As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 2), Color.FromArgb(153, 163, 173), Color.FromArgb(50, 50, 50), 90S)G.DrawRectangle(New Pen(InnerRect), New Rectangle(1, 1, Width - 3, Height - 3))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(73, 83, 93))), 1, Height - 2, Width - 2, Height - 2)G.DrawString(Text, Font, New SolidBrush(Color.FromArgb(200, 210, 220)), New Rectangle(0, -1, Width - 1, Height - 1), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})ElseG.Clear(Color.FromArgb(51, 61, 71))Dim LGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Height / 2 - 2), Color.FromArgb(43, 53, 63), Color.FromArgb(154, 163, 169), LinearGradientMode.Horizontal)G.FillRectangle(LGBOver, New Rectangle(2, 1, Width - 3, Height / 2 - 2))Dim LGBOver1 As New LinearGradientBrush(New Rectangle(0, 1, Width - 2, Height / 2 - 2), Color.FromArgb(154, 163, 169), Color.FromArgb(43, 53, 63), LinearGradientMode.Horizontal)G.FillRectangle(LGBOver1, New Rectangle(0, 1, Width / 2, Height / 2 - 2))G.SmoothingMode = SmoothingMode.HighQuality'----- Borders -----G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(43, 53, 63))), New Rectangle(0, 0, Width - 1, Height - 1))Dim InnerRect As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 2), Color.FromArgb(163, 173, 183), Color.FromArgb(60, 60, 60), 90)G.DrawRectangle(New Pen(InnerRect), New Rectangle(1, 1, Width - 3, Height - 3))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(83, 93, 103))), 1, Height - 2, Width - 2, Height - 2)G.DrawString(Text, Font, New SolidBrush(Color.FromArgb(200, 210, 220)), New Rectangle(0, -1, Width - 1, Height - 1), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})End IfCase MouseState.DownIf _Color2 ThenG.Clear(Color.FromArgb(37, 47, 57))Dim BTNLGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Height / 2 - 2), Color.FromArgb(35, 45, 55), Color.FromArgb(132, 141, 147), 180)G.FillRectangle(BTNLGBOver, New Rectangle(2, 1, Width - 3, Height / 2 - 2))Dim BTNLGB1 As New LinearGradientBrush(New Rectangle(0, 1, Width - 2, Height / 2 - 2), Color.FromArgb(132, 141, 147), Color.FromArgb(35, 45, 55), 180)G.FillRectangle(BTNLGB1, New Rectangle(0, 1, Width / 2, Height / 2 - 2))G.SmoothingMode = SmoothingMode.HighQuality'----- Borders -----G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(33, 43, 53))), New Rectangle(0, 0, Width - 1, Height - 1))Dim InnerRect As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 2), Color.FromArgb(93, 103, 113), Color.FromArgb(45, 45, 45), 90)G.DrawRectangle(New Pen(InnerRect), New Rectangle(1, 1, Width - 3, Height - 3))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(53, 63, 73))), 1, Height - 2, Width - 2, Height - 2)G.DrawString(Text, Font, New SolidBrush(ForeColor), New Rectangle(1, -1, Width - 1, Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})ElseG.Clear(Color.FromArgb(43, 53, 63))Dim BTNLGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Height / 2 - 2), Color.FromArgb(27, 37, 47), Color.FromArgb(130, 139, 145), LinearGradientMode.Horizontal)G.FillRectangle(BTNLGBOver, New Rectangle(2, 1, Width - 3, Height / 2 - 2))Dim BTNLGB1 As New LinearGradientBrush(New Rectangle(0, 1, Width - 2, Height / 2 - 2), Color.FromArgb(130, 139, 145), Color.FromArgb(27, 37, 47), LinearGradientMode.Horizontal)G.FillRectangle(BTNLGB1, New Rectangle(0, 1, Width / 2, Height / 2 - 2))G.SmoothingMode = SmoothingMode.HighQuality'----- Borders -----G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(33, 43, 53))), New Rectangle(0, 0, Width - 1, Height - 1))Dim InnerRect As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 2), Color.FromArgb(123, 133, 143), Color.FromArgb(55, 55, 55), 90)G.DrawRectangle(New Pen(InnerRect), New Rectangle(1, 1, Width - 3, Height - 3))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(73, 83, 93))), 2, Height - 2, Width - 2, Height - 2)G.DrawString(Text, Font, New SolidBrush(ForeColor), New Rectangle(1, -1, Width - 1, Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})End IfEnd Selecte.Graphics.DrawImage(bmp, 0, 0)G.Dispose()bmp.Dispose()End SubEnd ClassClass SharpFormInherits ContainerControlPrivate Header As IntegerPrivate Cap As BooleanPrivate MouseP As Point = New Point(0, 0)Private path As GraphicsPathProtected G As Graphics, bmp As BitmapPrivate Function RoundRect(ByVal r As RectangleF, ByVal r1 As Single, ByVal r2 As Single, ByVal r3 As Single, ByVal r4 As Single) As GraphicsPathDim x As Single = r.X, y As Single = r.Y, w As Single = r.Width, h As Single = r.HeightDim rr5 As GraphicsPath = New GraphicsPathrr5.AddBezier(x, y + r1, x, y, x + r1, y, x + r1, y)rr5.AddLine(x + r1, y, x + w - r2, y)rr5.AddBezier(x + w - r2, y, x + w, y, x + w, y + r2, x + w, y + r2)rr5.AddLine(x + w, y + r2, x + w, y + h - r3)rr5.AddBezier(x + w, y + h - r3, x + w, y + h, x + w - r3, y + h, x + w - r3, y + h)rr5.AddLine(x + w - r3, y + h, x + r4, y + h)rr5.AddBezier(x + r4, y + h, x, y + h, x, y + h - r4, x, y + h - r4)rr5.AddLine(x, y + h - r4, x, y + r1)Return rr5End Function#Region " Control Help - Movement & Flicker Control "Protected Overrides Sub OnInvalidated(ByVal e As System.Windows.Forms.InvalidateEventArgs)MyBase.OnInvalidated(e)ParentForm.FindForm.Text = TextEnd SubProtected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)MyBase.OnTextChanged(e)Invalidate()End SubProtected Overrides Sub OnCreateControl()MyBase.OnCreateControl()Me.ParentForm.FormBorderStyle = FormBorderStyle.NoneMe.ParentForm.TransparencyKey = Color.FuchsiaEnd SubProtected Overrides Sub CreateHandle()MyBase.CreateHandle()End SubProtected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)MyBase.OnMouseDown(e)If e.Button = Windows.Forms.MouseButtons.Left And New Rectangle(0, 0, Width, Header).Contains(e.Location) ThenCap = True : MouseP = e.LocationEnd IfEnd SubProtected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)MyBase.OnMouseUp(e) : Cap = FalseEnd SubProtected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)MyBase.OnMouseMove(e)If Cap ThenParent.Location = MousePosition - MousePEnd IfEnd SubPrivate Sub minimBtnClick() Handles minimBtn.ClickParentForm.FindForm.WindowState = FormWindowState.MinimizedEnd SubPrivate Sub closeBtnClick() Handles closeBtn.ClickIf CloseButtonExitsApp ThenSystem.Environment.Exit(0)ElseParentForm.FindForm.Close()End IfEnd SubPrivate _closesEnv As Boolean = FalsePublic Property CloseButtonExitsApp() As BooleanGetReturn _closesEnvEnd GetSet(ByVal v As Boolean)_closesEnv = vInvalidate()End SetEnd PropertyPrivate _minimBool As Boolean = TruePublic Property MinimizeButton() As BooleanGetReturn _minimBoolEnd GetSet(ByVal v As Boolean)_minimBool = vInvalidate()End SetEnd Property#End RegionDim WithEvents minimBtn As New SharpTopButton With {.TopButtonTXT = SharpTopButton.TxtState.Minim, .Location = New Point(Width - 60, 0)}Dim WithEvents closeBtn As New SharpTopButton With {.TopButtonTXT = SharpTopButton.TxtState.Close, .Location = New Point(Width - 40, 0)}Public Property Color2() As BooleanGetReturn _Color2End GetSet(ByVal value As Boolean)_Color2 = valueMe.Refresh()End SetEnd PropertyPrivate _Color2 As Boolean = TrueSub New()MyBase.new()Header = 25Dock = DockStyle.FillDoubleBuffered = TrueControls.Add(closeBtn)closeBtn.Refresh() : minimBtn.Refresh()End SubProtected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)bmp = New Bitmap(Width, Height)G = Graphics.FromImage(bmp)Dim TransparencyKey As Color = Me.ParentForm.TransparencyKeyMyBase.OnPaint(e)If _minimBool ThenControls.Add(minimBtn)ElseControls.Remove(minimBtn)End IfminimBtn.Location = New Point(Width - 60, 0)closeBtn.Location = New Point(Width - 40, 0)G.Clear(Color.FromArgb(43, 53, 63))'---- Sides--Dim LGBunderGrdrect As Rectangle = New Rectangle(1, Header, Width, 130)Dim LGBunderGrd As New LinearGradientBrush(LGBunderGrdrect, Color.FromArgb(43, 53, 63), Color.FromArgb(70, 79, 85), 90)G.FillRectangle(LGBunderGrd, LGBunderGrdrect)If _Color2 ThenDim BTNLGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Header / 2), Color.FromArgb(20, 30, 40), Color.FromArgb(135, Color.White), 360)G.FillRectangle(BTNLGBOver, New Rectangle(2, 1, Width - 3, Header / 2))Dim BTNLGB1 As New LinearGradientBrush(New Rectangle(-1, 1, Width, Header / 2), Color.FromArgb(100, Color.White), Color.FromArgb(20, 30, 40), 360)G.FillRectangle(BTNLGB1, New Rectangle(-1, 1, Width / 2, Header / 2))Dim txtbrushCL2 As Brush = New SolidBrush(Color.FromArgb(250, 250, 250))G.DrawString(Text, Font, txtbrushCL2, New Rectangle(16, 6, Width - 1, 22), New StringFormat With {.LineAlignment = StringAlignment.Near, .Alignment = StringAlignment.Near})ElseDim BTNLGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Header / 2), Color.FromArgb(35, 45, 55), Color.FromArgb(155, Color.White), 180)G.FillRectangle(BTNLGBOver, New Rectangle(2, 1, Width - 3, Header / 2))Dim BTNLGB1 As New LinearGradientBrush(New Rectangle(-1, 1, Width, Header / 2), Color.FromArgb(120, Color.White), Color.FromArgb(35, 45, 55), 180)G.FillRectangle(BTNLGB1, New Rectangle(-1, 1, Width / 2, Header / 2))Dim txtbrush As Brush = New SolidBrush(Color.FromArgb(210, 220, 230))G.DrawString(Text, Font, txtbrush, New Rectangle(16, 7, Width - 1, 22), New StringFormat With {.LineAlignment = StringAlignment.Near, .Alignment = StringAlignment.Near})End IfDim InerRecLGB As Rectangle = New Rectangle(11, 28, Width - 22, Height - 37)Dim InnerRecLGB As New LinearGradientBrush(InerRecLGB, Color.FromArgb(57, 67, 77), Color.FromArgb(60, 69, 75), 90)G.FillRectangle(InnerRecLGB, InerRecLGB)'----- InnerRectDim P1 As Pen = New Pen(New SolidBrush(Color.FromArgb(23, 33, 43)))G.DrawRectangle(P1, 12, 29, Width - 25, Height - 40)Dim P2 As Pen = New Pen(New SolidBrush(Color.FromArgb(93, 103, 113)))G.DrawRectangle(P2, 11, 28, Width - 23, Height - 38)Dim LGBunderGrd3 As New LinearGradientBrush(New Rectangle(0, Height - 9, Width \ 2, 50), Color.FromArgb(40, 50, 60), Color.FromArgb(50, Color.White), 360)G.FillRectangle(LGBunderGrd3, 0, Height - 9, Width \ 2, 50)Dim LGBunderGrd2 As New LinearGradientBrush(New Rectangle(Width \ 2, Height - 9, Width \ 2, Height), Color.FromArgb(40, 50, 60), Color.FromArgb(50, Color.White), 180)G.FillRectangle(LGBunderGrd2, Width \ 2, Height - 9, Width \ 2, Height)G.DrawLine(New Pen(Color.FromArgb(90, 90, 90)), Width \ 2, Height - 9, Width \ 2, Height)G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(137, 147, 157))), 1, 1, Width - 3, Height - 3)Dim ClientRectangle As New Rectangle(0, 0, Width - 1, Height - 1)G.DrawPath(Pens.Black, RoundRect(ClientRectangle, 0, 0, 0, 0))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(163, 173, 183))), 2, 1, Width - 3, 1)e.Graphics.DrawImage(bmp.Clone, 0, 0)bmp.Dispose()G.Dispose()End SubEnd ClassClass SharpTopButtonInherits Control#Region " Control Help - MouseState & Flicker Control"Enum MouseState As ByteNone = 0Over = 1Down = 2Block = 3End EnumPrivate State As MouseStateDim X As IntegerProtected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)MyBase.OnMouseEnter(e)State = MouseState.OverInvalidate()End SubProtected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)MyBase.OnMouseDown(e)State = MouseState.DownInvalidate()End SubProtected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)MyBase.OnMouseLeave(e)State = MouseState.NoneInvalidate()End SubProtected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)MyBase.OnMouseUp(e)State = MouseState.OverInvalidate()End SubProtected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)End SubProtected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)MyBase.OnTextChanged(e)Invalidate()End SubProtected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)MyBase.OnMouseMove(e)X = e.XInvalidate()End Sub#End RegionEnum TxtState As ByteClose = 1Minim = 2End EnumPrivate BtnTxt As TxtStatePublic Property TopButtonTXT() As TxtStateGetReturn BtnTxtEnd GetSet(ByVal v As TxtState)BtnTxt = vInvalidate()End SetEnd PropertySub New()MyBase.New()BackColor = Color.FromArgb(38, 38, 38)Font = New Font("Verdana", 8.25F)Size = New Size(30, 20)DoubleBuffered = TrueFocus()End SubProtected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)Dim bmp As New Bitmap(Width, Height)Dim G As Graphics = Graphics.FromImage(bmp)MyBase.OnPaint(e)Select Case StateCase MouseState.OverIf BtnTxt = TxtState.Close ThenG.Clear(Color.FromArgb(170, 18, 32))Dim LGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Height / 2 - 2), Color.FromArgb(170, 18, 32), Color.FromArgb(147, 156, 162), 360)G.FillRectangle(LGBOver, New Rectangle(2, 1, Width - 3, Height / 2 - 2))Dim LGBOver1 As New LinearGradientBrush(New Rectangle(0, 1, Width - 2, Height / 2 - 2), Color.FromArgb(147, 156, 162), Color.FromArgb(170, 18, 32), 360)G.FillRectangle(LGBOver1, New Rectangle(0, 1, Width / 2, Height / 2 - 2))G.SmoothingMode = SmoothingMode.HighQuality'----- Borders -----G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(39, 49, 59))), New Rectangle(0, 0, Width - 1, Height - 1))Dim InnerRect As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 2), Color.FromArgb(159, 169, 179), Color.FromArgb(90, 90, 90), 90)G.DrawRectangle(New Pen(InnerRect), New Rectangle(1, 1, Width - 3, Height - 3))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(123, 133, 143))), 1, Height - 2, Width - 2, Height - 2)ElseIf BtnTxt = TxtState.Minim ThenG.Clear(Color.FromArgb(0, 102, 175))Dim LGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Height / 2 - 2), Color.FromArgb(0, 102, 175), Color.FromArgb(157, 166, 172), 360)G.FillRectangle(LGBOver, New Rectangle(2, 1, Width - 3, Height / 2 - 2))Dim LGBOver1 As New LinearGradientBrush(New Rectangle(0, 1, Width - 2, Height / 2 - 2), Color.FromArgb(157, 166, 172), Color.FromArgb(0, 102, 175), 360)G.FillRectangle(LGBOver1, New Rectangle(0, 1, Width / 2, Height / 2 - 2))G.SmoothingMode = SmoothingMode.HighQuality'----- Borders -----G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(39, 49, 59))), New Rectangle(0, 0, Width - 1, Height - 1))Dim InnerRect As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 2), Color.FromArgb(159, 169, 179), Color.FromArgb(90, 90, 90), 90)G.DrawRectangle(New Pen(InnerRect), New Rectangle(1, 1, Width - 3, Height - 3))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(123, 133, 143))), 1, Height - 2, Width - 2, Height - 2)End IfCase MouseState.NoneIf BtnTxt = TxtState.Close ThenG.Clear(Color.FromArgb(140, 18, 32))Dim LGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Height / 2 - 2), Color.FromArgb(140, 18, 32), Color.FromArgb(117, 126, 132), 360)G.FillRectangle(LGBOver, New Rectangle(2, 1, Width - 3, Height / 2 - 2))Dim LGBOver1 As New LinearGradientBrush(New Rectangle(0, 1, Width - 2, Height / 2 - 2), Color.FromArgb(117, 126, 132), Color.FromArgb(140, 18, 32), 360)G.FillRectangle(LGBOver1, New Rectangle(0, 1, Width / 2, Height / 2 - 2))G.SmoothingMode = SmoothingMode.HighQuality'----- Borders -----G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(33, 43, 53))), New Rectangle(0, 0, Width - 1, Height - 1))Dim InnerRect As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 2), Color.FromArgb(153, 163, 173), Color.FromArgb(85, 85, 85), 90)G.DrawRectangle(New Pen(InnerRect), New Rectangle(1, 1, Width - 3, Height - 3))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(103, 113, 123))), 1, Height - 2, Width - 2, Height - 2)ElseIf BtnTxt = TxtState.Minim ThenG.Clear(Color.FromArgb(0, 102, 156))Dim LGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Height / 2 - 2), Color.FromArgb(0, 102, 156), Color.FromArgb(117, 126, 132), 360)G.FillRectangle(LGBOver, New Rectangle(2, 1, Width - 3, Height / 2 - 2))Dim LGBOver1 As New LinearGradientBrush(New Rectangle(0, 1, Width - 2, Height / 2 - 2), Color.FromArgb(117, 126, 132), Color.FromArgb(0, 102, 156), 360)G.FillRectangle(LGBOver1, New Rectangle(0, 1, Width / 2, Height / 2 - 2))G.SmoothingMode = SmoothingMode.HighQuality'----- Borders -----G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(33, 43, 53))), New Rectangle(0, 0, Width - 1, Height - 1))Dim InnerRect As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 2), Color.FromArgb(153, 163, 173), Color.FromArgb(85, 85, 85), 90)G.DrawRectangle(New Pen(InnerRect), New Rectangle(1, 1, Width - 3, Height - 3))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(103, 113, 123))), 1, Height - 2, Width - 2, Height - 2)End IfCase MouseState.DownIf BtnTxt = TxtState.Close ThenG.Clear(Color.FromArgb(130, 18, 32))Dim LGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Height / 2 - 2), Color.FromArgb(130, 18, 32), Color.FromArgb(117, 126, 132), 360)G.FillRectangle(LGBOver, New Rectangle(2, 1, Width - 3, Height / 2 - 2))Dim LGBOver1 As New LinearGradientBrush(New Rectangle(0, 1, Width - 2, Height / 2 - 2), Color.FromArgb(117, 126, 132), Color.FromArgb(130, 18, 32), 360)G.FillRectangle(LGBOver1, New Rectangle(0, 1, Width / 2, Height / 2 - 2))G.SmoothingMode = SmoothingMode.HighQuality'----- Borders -----G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(30, 40, 50))), New Rectangle(0, 0, Width - 1, Height - 1))Dim InnerRect As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 2), Color.FromArgb(151, 161, 171), Color.FromArgb(83, 83, 83), 90)G.DrawRectangle(New Pen(InnerRect), New Rectangle(1, 1, Width - 3, Height - 3))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(97, 107, 117))), 1, Height - 2, Width - 2, Height - 2)ElseIf BtnTxt = TxtState.Minim ThenG.Clear(Color.FromArgb(0, 102, 146))Dim LGBOver As New LinearGradientBrush(New Rectangle(2, 1, Width - 3, Height / 2 - 2), Color.FromArgb(0, 102, 154), Color.FromArgb(132, 141, 147), 360)G.FillRectangle(LGBOver, New Rectangle(2, 1, Width - 3, Height / 2 - 2))Dim LGBOver1 As New LinearGradientBrush(New Rectangle(0, 1, Width - 2, Height / 2 - 2), Color.FromArgb(132, 141, 147), Color.FromArgb(0, 102, 154), 360)G.FillRectangle(LGBOver1, New Rectangle(0, 1, Width / 2, Height / 2 - 2))G.SmoothingMode = SmoothingMode.HighQuality'----- Borders -----G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(37, 47, 57))), New Rectangle(0, 0, Width - 1, Height - 1))Dim InnerRect1 As New LinearGradientBrush(New Rectangle(1, 1, Width - 3, Height - 3), Color.FromArgb(150, 150, 150), Color.FromArgb(127, 137, 147), 90S)G.DrawRectangle(New Pen(InnerRect1), New Rectangle(1, 1, Width - 3, Height - 3))End IfEnd SelectSelect Case BtnTxtCase TxtState.CloseSize = New Size(30, 20)G.DrawString("r", New Font("Marlett", 8.75), New SolidBrush(Color.FromArgb(220, Color.White)), New Rectangle(0, 1, Width - 1, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})Case TxtState.MinimSize = New Size(25, 20)G.DrawString("0", New Font("Marlett", 12), New SolidBrush(Color.FromArgb(220, Color.White)), New Rectangle(1, -1, Width - 1, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})End Select' G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(40, 40, 40))), 0, 0, 29, 19)e.Graphics.DrawImage(bmp.Clone(), 0, 0)G.Dispose() : bmp.Dispose()End SubEnd ClassClass SharpGroupBOxInherits ContainerControl#Region " Control Help - Properties & Flicker Control"Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)MyBase.OnTextChanged(e)Invalidate()End Sub#End RegionSub New()MyBase.New()Size = New Size(200, 100)SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)'BackColor = Color.TransparentDoubleBuffered = TrueForeColor = Color.FromArgb(210, 220, 230)End SubProtected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)Dim bmp As New Bitmap(Width, Height)Dim G As Graphics = Graphics.FromImage(bmp)MyBase.OnPaint(e)G.SmoothingMode = SmoothingMode.HighQualityG.Clear(Color.FromArgb(43, 53, 63))Dim s2 As New LinearGradientBrush(New Rectangle(0, 2, Width - 3, 25), Color.FromArgb(35, 45, 55), Color.FromArgb(50, Color.White), 90S)G.FillRectangle(s2, New Rectangle(1, 14, Width - 3, 13))Dim s1 As New LinearGradientBrush(New Rectangle(0, 2, Width - 3, 25), Color.FromArgb(90, Color.White), Color.FromArgb(35, 45, 55), 90S)G.FillRectangle(s1, New Rectangle(1, 1, Width - 3, 13))G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(30, 40, 50))), 0, 0, Width - 1, 28)G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(111, 121, 131))), 1, 1, Width - 3, 26)G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(30, 40, 50))), 0, 30, Width - 1, Height - 31)G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(60, 70, 80))), 1, 31, Width - 3, Height - 33)G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(30, 30, 30))), New Rectangle(0, 0, Width - 1, Height - 1))G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(20, 30, 40))), 1, 29, Width - 2, 29)G.DrawString(Text, Font, New SolidBrush(ForeColor), New Rectangle(1, 4, Width, 20), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})e.Graphics.DrawImage(bmp.Clone(), 0, 0)G.Dispose() : bmp.Dispose()End SubEnd ClassClass SharpProgreSsBarInherits ControlPrivate GlowAnimation As Timer = New Timer'Private _GlowColor As Color = Color.FromArgb(55, 65, 75)Private _GlowColor As Color = Color.FromArgb(50, 255, 255, 255)Private _Animate As Boolean = TruePrivate _Value As Int32 = 0Private _HighlightColor As Color = Color.SilverPrivate _BackgroundColor As Color = Color.FromArgb(150, 150, 150)Private _StartColor As Color = Color.FromArgb(110, 110, 110)#Region "Properties"Public Property Color() As ColorGetReturn _StartColorEnd GetSet(ByVal value As Color)_StartColor = valueMe.Invalidate()End SetEnd PropertyPublic Property Animate() As BooleanGetReturn _AnimateEnd GetSet(ByVal value As Boolean)_Animate = valueIf value = True ThenGlowAnimation.Start()ElseGlowAnimation.Stop()End IfMe.Invalidate()End SetEnd PropertyPublic Property GlowColor() As ColorGetReturn _GlowColorEnd GetSet(ByVal value As Color)_GlowColor = valueMe.Invalidate()End SetEnd PropertyPublic Property Value() As Int32GetReturn _ValueEnd GetSet(ByVal value As Int32)If value < 0 Then Return_Value = valueIf value < 100 Then GlowAnimation.Start()Me.Invalidate()End SetEnd PropertyPublic Property BackgroundColor() As ColorGetReturn _BackgroundColorEnd GetSet(ByVal value As Color)_BackgroundColor = valueMe.Invalidate()End SetEnd PropertyPublic Property HighlightColor() As ColorGetReturn _HighlightColorEnd GetSet(ByVal value As Color)_HighlightColor = valueMe.Invalidate()End SetEnd Property#End RegionPrivate Function InDesignMode() As BooleanReturn (LicenseManager.UsageMode = LicenseUsageMode.Designtime)End FunctionSub New()MyBase.New()DoubleBuffered = TrueSetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)If Not InDesignMode() ThenGlowAnimation.Interval = 15If Value < 100 Then GlowAnimation.Start()AddHandler GlowAnimation.Tick, AddressOf GlowAnimation_TickEnd IfEnd SubPrivate _mGlowPosition As Integer = -100Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)Dim B As New Bitmap(Width, Height)Dim G As Graphics = Graphics.FromImage(B)G.SmoothingMode = SmoothingMode.HighQualityG.Clear(Color.FromArgb(43, 53, 63))' -------------------Draw Background for the MBProgressBar--------------------Dim s2 As New LinearGradientBrush(New Rectangle(0, 2, Width - 3, 50), Color.FromArgb(35, 45, 55), Color.FromArgb(50, Color.White), 90S)Dim s1 As New LinearGradientBrush(New Rectangle(0, 2, Width - 3, 50), Color.FromArgb(75, Color.White), Color.FromArgb(35, 45, 55), 90)Dim BackRectangle As Rectangle = Me.ClientRectangleBackRectangle.Width = BackRectangle.Width - 1BackRectangle.Height = BackRectangle.Height - 1Dim GrafP As GraphicsPath = RoundRect(BackRectangle, 2, 2, 2, 2)G.FillPath(s1, GrafP)'--------------------Draw Background Shadows for MBProgrssBar------------------Dim BGSH As Rectangle = New Rectangle(2, 2, 10, Me.Height - 5)Dim LGBS As LinearGradientBrush = New LinearGradientBrush(BGSH, Color.FromArgb(70, 80, 90), Color.FromArgb(95, 105, 115), LinearGradientMode.Horizontal)G.FillRectangle(LGBS, BGSH)Dim BGSRectangle As Rectangle = New Rectangle(Me.Width - 12, 2, 10, Me.Height - 5)Dim LG As LinearGradientBrush = New LinearGradientBrush(BGSRectangle, Color.FromArgb(80, 90, 100), Color.FromArgb(75, 85, 95), LinearGradientMode.Horizontal)G.FillRectangle(LG, BGSRectangle)'----------------------Draw MBProgressBar-------------------- Dim ProgressRect As Rectangle = New Rectangle(1, 2, Me.Width - 3, Me.Height - 3)ProgressRect.Width = CInt((Value * 1.0F / (100) * Me.Width))G.FillRectangle(s2, ProgressRect)'----------------------Draw Shadows for MBProgressBar------------------Dim SHRect As Rectangle = New Rectangle(1, 2, 15, Me.Height - 3)Dim LGSHP As LinearGradientBrush = New LinearGradientBrush(SHRect, Color.Black, Color.Black, LinearGradientMode.Horizontal)Dim BColor As ColorBlend = New ColorBlend(3)BColor.Colors = New Color() {Color.Gray, Color.FromArgb(40, 0, 0, 0), Color.Transparent}BColor.Positions = New Single() {0.0F, 0.2F, 1.0F}LGSHP.InterpolationColors = BColorSHRect.X = SHRect.X - 1G.FillRectangle(LGSHP, SHRect)Dim Rect1 As Rectangle = New Rectangle(Me.Width - 3, 2, 15, Me.Height - 3)Rect1.X = CInt((Value * 1.0F / (100) * Me.Width) - 14)Dim LGSH1 As LinearGradientBrush = New LinearGradientBrush(Rect1, Color.Black, Color.Black, LinearGradientMode.Horizontal)Dim BColor1 As ColorBlend = New ColorBlend(3)BColor1.Colors = New Color() {Color.Transparent, Color.FromArgb(70, 0, 0, 0), Color.Transparent}BColor1.Positions = New Single() {0.0F, 0.8F, 1.0F}LGSH1.InterpolationColors = BColor1G.FillRectangle(LGSH1, Rect1)'-------------------------Draw Highlight for MBProgressBar-----------------Dim HLRect As Rectangle = New Rectangle(1, 1, Me.Width - 1, 6)Dim HLGPa As GraphicsPath = RoundRect(HLRect, 2, 2, 0, 0)'G.SetClip(HLGPa)Dim HLGBS As LinearGradientBrush = New LinearGradientBrush(HLRect, Color.FromArgb(190, 190, 190), Color.FromArgb(150, 150, 150), LinearGradientMode.Vertical)G.FillPath(HLGBS, HLGPa)G.ResetClip()Dim HLrect2 As Rectangle = New Rectangle(1, Me.Height - 8, Me.Width - 1, 6)Dim bp1 As GraphicsPath = RoundRect(HLrect2, 0, 0, 2, 2)' G.SetClip(bp1)Dim bg1 As LinearGradientBrush = New LinearGradientBrush(HLrect2, Color.Transparent, Color.FromArgb(150, Me.HighlightColor), LinearGradientMode.Vertical)G.FillPath(bg1, bp1)G.ResetClip()'--------------------Draw Inner Sroke for MBProgressBar--------------Dim Rect20 As Rectangle = Me.ClientRectangleRect20.X = Rect20.X + 1Rect20.Y = Rect20.Y + 1Rect20.Width -= 3Rect20.Height -= 3Dim Rect15 As GraphicsPath = RoundRect(Rect20, 2, 2, 2, 2)G.DrawPath(New Pen(Color.FromArgb(55, 65, 75)), Rect15)'-----------------------Draw Outer Stroke on the Control----------------------------Dim StrokeRect As Rectangle = Me.ClientRectangleStrokeRect.Width = StrokeRect.Width - 1StrokeRect.Height = StrokeRect.Height - 1Dim GGH As GraphicsPath = RoundRect(StrokeRect, 2, 2, 2, 2)G.DrawPath(New Pen(Color.FromArgb(122, 122, 122)), GGH)'------------------------Draw Glow for MBProgressBar-----------------------Dim GlowRect As Rectangle = New Rectangle(_mGlowPosition, 6, 60, 60)Dim GlowLGBS As LinearGradientBrush = New LinearGradientBrush(GlowRect, Color.FromArgb(127, 137, 147), Color.FromArgb(75, 85, 95), LinearGradientMode.Horizontal)Dim BColor3 As ColorBlend = New ColorBlend(4)BColor3.Colors = New Color() {Color.Transparent, Me.GlowColor, Me.GlowColor, Color.Transparent}BColor3.Positions = New Single() {0.0F, 0.5F, 0.6F, 1.0F}GlowLGBS.InterpolationColors = BColor3Dim clip As Rectangle = New Rectangle(1, 2, Me.Width - 3, Me.Height - 3)clip.Width = CInt((Value * 1.0F / (100) * Me.Width))G.SetClip(clip)G.FillRectangle(GlowLGBS, GlowRect)G.ResetClip()e.Graphics.DrawImage(B.Clone(), 0, 0)G.Dispose() : B.Dispose()End SubPrivate Function RoundRect(ByVal r As RectangleF, ByVal r1 As Single, ByVal r2 As Single, ByVal r3 As Single, ByVal r4 As Single) As GraphicsPathDim x As Single = r.X, y As Single = r.Y, w As Single = r.Width, h As Single = r.HeightDim rr5 As GraphicsPath = New GraphicsPathrr5.AddBezier(x, y + r1, x, y, x + r1, y, x + r1, y)rr5.AddLine(x + r1, y, x + w - r2, y)rr5.AddBezier(x + w - r2, y, x + w, y, x + w, y + r2, x + w, y + r2)rr5.AddLine(x + w, y + r2, x + w, y + h - r3)rr5.AddBezier(x + w, y + h - r3, x + w, y + h, x + w - r3, y + h, x + w - r3, y + h)rr5.AddLine(x + w - r3, y + h, x + r4, y + h)rr5.AddBezier(x + r4, y + h, x, y + h, x, y + h - r4, x, y + h - r4)rr5.AddLine(x, y + h - r4, x, y + r1)Return rr5End FunctionPrivate Sub GlowAnimation_Tick(ByVal sender As Object, ByVal e As EventArgs)If Me.Animate Then_mGlowPosition += 4If _mGlowPosition > Me.Width Then_mGlowPosition = -10Me.Invalidate()End IfElseGlowAnimation.Stop()_mGlowPosition = -50End IfEnd SubEnd ClassClass SharpTextBox : Inherits ControlDim WithEvents txtbox As New TextBox#Region " Control Help - Properties & Flicker Control "Private _passmask As Boolean = FalsePublic Shadows Property UseSystemPasswordChar() As BooleanGetReturn _passmaskEnd GetSet(ByVal v As Boolean)txtbox.UseSystemPasswordChar = UseSystemPasswordChar_passmask = vInvalidate()End SetEnd PropertyPrivate _maxchars As Integer = 32767Public Shadows Property MaxLength() As IntegerGetReturn _maxcharsEnd GetSet(ByVal v As Integer)_maxchars = vtxtbox.MaxLength = MaxLengthInvalidate()End SetEnd PropertyPrivate _align As HorizontalAlignmentPublic Shadows Property TextAlignment() As HorizontalAlignmentGetReturn _alignEnd GetSet(ByVal v As HorizontalAlignment)_align = vInvalidate()End SetEnd PropertyProtected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)End SubProtected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)MyBase.OnTextChanged(e)Invalidate()End SubProtected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)MyBase.OnBackColorChanged(e)txtbox.BackColor = BackColorInvalidate()End SubProtected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)MyBase.OnForeColorChanged(e)txtbox.ForeColor = ForeColorInvalidate()End SubProtected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)MyBase.OnFontChanged(e)txtbox.Font = FontEnd SubProtected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)MyBase.OnGotFocus(e)txtbox.Focus()End SubSub TextChngTxtBox() Handles txtbox.TextChangedText = txtbox.TextEnd SubSub TextChng() Handles MyBase.TextChangedtxtbox.Text = TextEnd SubSub NewTextBox()With txtbox.Multiline = False.BackColor = Color.FromArgb(43, 43, 43).ForeColor = ForeColor.Text = String.Empty.TextAlign = HorizontalAlignment.Center.BorderStyle = BorderStyle.None.Location = New Point(5, 5).Font = New Font("Verdana", 8).Size = New Size(Width - 10, Height - 11).UseSystemPasswordChar = UseSystemPasswordCharEnd WithEnd Sub#End RegionSub New()MyBase.New()NewTextBox()Controls.Add(txtbox)Text = ""BackColor = Color.FromArgb(35, 45, 55)ForeColor = Color.FromArgb(162, 172, 182)Size = New Size(135, 35)DoubleBuffered = TrueEnd SubProtected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)Dim B As New Bitmap(Width, Height)Dim G As Graphics = Graphics.FromImage(B)G.SmoothingMode = SmoothingMode.HighQualityMyBase.OnPaint(e)Height = txtbox.Height + 11With txtbox.Width = Width - 10.TextAlign = TextAlignment.UseSystemPasswordChar = UseSystemPasswordCharEnd WithG.Clear(Color.FromArgb(35, 45, 55))Dim txtRect As New Rectangle(0, 0, Width - 1, Height - 1)Dim InnerRect As New LinearGradientBrush(txtRect, Color.FromArgb(74, 84, 94), Color.FromArgb(94, 104, 114), 90S)G.DrawRectangle(New Pen(Color.FromArgb(12, 22, 32), 2), txtRect)G.DrawLine(New Pen(InnerRect), Width - 1, 0, Width - 1, Height)G.DrawLine(New Pen(InnerRect), 0, Height - 1, Width - 1, Height - 1)e.Graphics.DrawImage(B.Clone(), 0, 0)G.Dispose() : B.Dispose()End SubEnd ClassClass SharpCheckBox : Inherits Control#Region " Control Help - MouseState & Flicker Control"Private State As MouseState = MouseState.NoneProtected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)MyBase.OnMouseEnter(e)State = MouseState.OverInvalidate()End SubProtected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)MyBase.OnMouseDown(e)State = MouseState.DownInvalidate()End SubProtected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)MyBase.OnMouseLeave(e)State = MouseState.NoneInvalidate()End SubProtected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)MyBase.OnMouseUp(e)State = MouseState.OverInvalidate()End SubProtected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)MyBase.OnTextChanged(e)Invalidate()End SubPrivate _Checked As BooleanProperty Checked() As BooleanGetReturn _CheckedEnd GetSet(ByVal value As Boolean)_Checked = valueInvalidate()End SetEnd PropertyProtected Overrides Sub OnClick(ByVal e As System.EventArgs)_Checked = Not _CheckedRaiseEvent CheckedChanged(Me)MyBase.OnClick(e)End SubEvent CheckedChanged(ByVal sender As Object)Protected Overrides Sub OnResize(ByVal e As System.EventArgs)MyBase.OnResize(e)Height = 18End Sub#End RegionSub New()MyBase.New()SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)BackColor = Color.TransparentSize = New Size(145, 16)ForeColor = Color.FromArgb(210, 210, 222)DoubleBuffered = TrueFont = New Font("Verdana", 8)End SubProtected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)Dim B As New Bitmap(Width, Height)Dim G As Graphics = Graphics.FromImage(B)MyBase.OnPaint(e)G.SmoothingMode = SmoothingMode.HighQualityG.Clear(BackColor)If Checked = False ThenDim BTNLGBOver As New LinearGradientBrush(New Rectangle(3, 3, 12, 11), Color.FromArgb(37, 47, 57), Color.FromArgb(62, 68, 74), 90)G.FillRectangle(BTNLGBOver, New Rectangle(3, 3, 12, 11))ElseDim BTNLGBOver As New LinearGradientBrush(New Rectangle(3, 3, 12, 11), Color.FromArgb(73, 83, 93), Color.FromArgb(40, 50, 60), 90)G.FillRectangle(BTNLGBOver, New Rectangle(3, 3, 12, 11))Dim chkRec12 As New Rectangle(3, 2, Height - 5, Height - 6)Dim chkPoly As Rectangle = New Rectangle(chkRec12.X + chkRec12.Width / 4, chkRec12.Y + chkRec12.Height / 4, chkRec12.Width \ 2, chkRec12.Height \ 2)Dim Poly() As Point = {New Point(chkPoly.X, chkPoly.Y + chkPoly.Height \ 2), _New Point(chkPoly.X + chkPoly.Width \ 2, chkPoly.Y + chkPoly.Height), _New Point(chkPoly.X + chkPoly.Width, chkPoly.Y)}Dim P1 As Pen = New Pen((Color.White), 2)For i = 0 To Poly.Length - 2G.DrawLine(P1, Poly(i), Poly(i + 1))NextEnd IfG.DrawRectangle(New Pen(Color.FromArgb(93, 103, 113)), 1, 1, 16, 15)G.DrawRectangle(New Pen(Color.FromArgb(13, 23, 33)), 2, 2, 14, 13)G.DrawRectangle(New Pen(Color.FromArgb(113, 123, 133)), 3, 3, 12, 11)Dim txtbrush As Brush = New SolidBrush(Color.FromArgb(210, 220, 230))G.DrawString(Text, Font, txtbrush, New Point(18, 2), New StringFormat With {.LineAlignment = StringAlignment.Near, .Alignment = StringAlignment.Near})e.Graphics.DrawImage(B.Clone(), 0, 0)G.Dispose() : B.Dispose()End SubEnd ClassClass SharpRadioButton : Inherits Control#Region " Control Help - MouseState & Flicker Control"Enum MouseState As ByteNone = 0Over = 1Down = 2Block = 3End EnumPrivate State As MouseState = MouseState.NoneProtected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)MyBase.OnMouseEnter(e)State = MouseState.OverInvalidate()End SubProtected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)MyBase.OnMouseDown(e)State = MouseState.DownInvalidate()End SubProtected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)MyBase.OnMouseLeave(e)State = MouseState.NoneInvalidate()End SubProtected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)MyBase.OnMouseUp(e)State = MouseState.OverInvalidate()End SubProtected Overrides Sub OnResize(ByVal e As System.EventArgs)MyBase.OnResize(e)Height = 16End SubProtected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)MyBase.OnTextChanged(e)Invalidate()End SubPrivate _Checked As BooleanProperty Checked() As BooleanGetReturn _CheckedEnd GetSet(ByVal value As Boolean)_Checked = valueInvalidateControls()RaiseEvent CheckedChanged(Me)Invalidate()End SetEnd PropertyProtected Overrides Sub OnClick(ByVal e As EventArgs)If Not _Checked Then Checked = TrueMyBase.OnClick(e)End SubEvent CheckedChanged(ByVal sender As Object)Protected Overrides Sub OnCreateControl()MyBase.OnCreateControl()InvalidateControls()End SubPrivate Sub InvalidateControls()If Not IsHandleCreated OrElse Not _Checked Then ReturnFor Each C As Control In Parent.ControlsIf C IsNot Me AndAlso TypeOf C Is SharpRadioButton ThenDirectCast(C, SharpRadioButton).Checked = FalseEnd IfNextEnd Sub#End RegionSub New()MyBase.New()SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)BackColor = Color.TransparentSize = New Size(150, 16)ForeColor = Color.FromArgb(210, 210, 222)DoubleBuffered = TrueFont = New Font("Verdana", 8)End SubProtected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)Dim B As New Bitmap(Width, Height)Dim G As Graphics = Graphics.FromImage(B)G.SmoothingMode = SmoothingMode.HighQualityMyBase.OnPaint(e)G.Clear(BackColor)If Checked = False ThenDim BTNLGBOver As New LinearGradientBrush(New Rectangle(3, 3, 12, 11), Color.FromArgb(37, 47, 57), Color.FromArgb(62, 68, 74), 90)G.FillEllipse(BTNLGBOver, New Rectangle(3, 3, 12, 11))G.DrawEllipse(New Pen(Color.FromArgb(0, 0, 0)), 2, 2, 14, 13)ElseDim CKelGrd As New LinearGradientBrush(New Rectangle(3, 3, 12, 11), Color.FromArgb(65, 71, 77), Color.FromArgb(0, 0, 0), 90)G.FillEllipse(CKelGrd, New Rectangle(3, 3, 12, 11))G.DrawEllipse(New Pen(Color.FromArgb(13, 23, 33)), 2, 2, 14, 13)End IfG.DrawEllipse(New Pen(Color.FromArgb(93, 103, 113)), 1, 1, 15, 14)G.DrawEllipse(New Pen(Color.FromArgb(113, 123, 133)), 3, 3, 11, 10)Dim txtbrush As Brush = New SolidBrush(Color.FromArgb(210, 220, 230))G.DrawString(Text, Font, txtbrush, New Point(18, 2), New StringFormat With {.LineAlignment = StringAlignment.Near, .Alignment = StringAlignment.Near})e.Graphics.DrawImage(B.Clone(), 0, 0)G.Dispose() : B.Dispose()End SubEnd ClassMenampilkan skin[arioardi.blogspot.com].txt.