SaketSaket

SweetTheme for HF

Mar 15th, 2014
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 19.35 KB | None | 0 0
  1. Option Strict On
  2.  
  3. Imports System.Drawing.Drawing2D
  4.  
  5. 'Please Leave Credits in Source, Do not redistribute
  6.  
  7. '<info>
  8. ' -----------------Sweet Theme-----------------
  9. ' Creator - SaketSaket (HF)
  10. ' Version - 1.0
  11. ' Date Created - 25th February 2014
  12. ' Date Modified - 15th March 2014
  13. '
  14. ' UID -
  15. ' For bugs & Constructive Criticism contact me on HF
  16. ' If you like it & want to donate then pm me on HF
  17. ' -----------------Sweet Theme-----------------
  18. '<info>
  19.  
  20. 'Please Leave Credits in Source, Do not redistribute
  21.  
  22. Public Class SweetForm : Inherits ContainerControl
  23.  
  24.     Private _icon As Icon
  25.  
  26.     Public Property Icon() As Icon
  27.         Get
  28.             Return _icon
  29.         End Get
  30.         Set(ByVal value As Icon)
  31.             _icon = value
  32.             Invalidate()
  33.         End Set
  34.     End Property
  35.  
  36.     Sub New()
  37.         MyBase.New()
  38.         Dock = DockStyle.Fill
  39.         SetStyle(ControlStyles.AllPaintingInWmPaint, True)
  40.         SetStyle(ControlStyles.ResizeRedraw, True)
  41.     End Sub
  42.  
  43.     Protected Overrides Sub OnCreateControl()
  44.         MyBase.OnCreateControl()
  45.         ParentForm.FormBorderStyle = FormBorderStyle.None
  46.     End Sub
  47.  
  48.     Protected Overrides Sub OnInvalidated(ByVal e As InvalidateEventArgs)
  49.         MyBase.OnInvalidated(e)
  50.         ParentForm.FindForm.Text = Text
  51.     End Sub
  52.  
  53.     Protected Overrides Sub OnTextChanged(ByVal e As EventArgs)
  54.         MyBase.OnTextChanged(e)
  55.         Invalidate()
  56.     End Sub
  57.  
  58.     Protected Overrides Sub CreateHandle()
  59.         MyBase.CreateHandle()
  60.         If ParentForm.FindForm.TransparencyKey = Nothing Then ParentForm.FindForm.TransparencyKey = Color.Fuchsia
  61.     End Sub
  62.  
  63.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  64.         MyBase.OnPaint(e)
  65.         Dim g As Graphics = e.Graphics
  66.         g.SmoothingMode = SmoothingMode.HighQuality
  67.         Dim cr As Rectangle = New Rectangle(0, 0, Width, Height)
  68.         g.FillRectangle(New SolidBrush(Color.FromArgb(86, 186, 236)), cr)
  69.         g.FillRectangle(New SolidBrush(Color.FromArgb(255, 255, 240)), New Rectangle(5, 40, Width - 10, Height - 45))
  70.         g.DrawString(Text, New Font("Tahoma", 12, FontStyle.Bold), New SolidBrush(Color.FromArgb(255, 255, 255)), New Rectangle(0, 0, Width - 5, 45), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  71.         If ParentForm.FindForm.Width > 400 Then
  72.             g.FillEllipse(New SolidBrush(Color.FromArgb(255, 255, 240)), New Rectangle(Width - 150, 5, 40, 30))
  73.             Dim themelogo As String
  74.             Dim x, y As Integer
  75.             Dim ncr As Rectangle = New Rectangle(35, 5, 55, 40)
  76.             Dim themelogofont As New Font("Wingdings", 8, FontStyle.Bold)
  77.             Dim themelogomybrush As New LinearGradientBrush(ncr, Color.Chocolate, Color.BurlyWood, LinearGradientMode.Vertical)
  78.             Dim themelogodrawformat As New StringFormat()
  79.             themelogodrawformat.FormatFlags = StringFormatFlags.NoFontFallback
  80.             themelogo = "t"
  81.             x = 58
  82.             y = 7
  83.             g.DrawString(themelogo, themelogofont, themelogomybrush, x, y, themelogodrawformat)
  84.             themelogo = "ttt"
  85.             x = 49
  86.             y = 16
  87.             g.DrawString(themelogo, themelogofont, themelogomybrush, x, y, themelogodrawformat)
  88.             themelogo = "ttttt"
  89.             x = 40
  90.             y = 25
  91.             g.DrawString(themelogo, themelogofont, themelogomybrush, x, y, themelogodrawformat)
  92.             Dim newthemelogofont As New Font("Tahoma", 12, FontStyle.Bold)
  93.             Dim newthemelogomybrush As New SolidBrush(Color.Blue)
  94.             themelogo = "S"
  95.             x = Width - 138
  96.             y = 11
  97.             g.DrawString(themelogo, newthemelogofont, newthemelogomybrush, x, y, themelogodrawformat)
  98.         End If
  99.         Try
  100.             g.DrawIcon(_icon, New Rectangle(8, 8, 28, 28))
  101.         Catch : End Try
  102.         g.Dispose()
  103.     End Sub
  104. End Class
  105.  
  106. Public Class SweetControlBox : Inherits Control
  107.  
  108.     Dim _minr, _maxr, _cr As Rectangle
  109.  
  110.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  111.         MyBase.OnPaint(e)
  112.         Dim g As Graphics = e.Graphics
  113.         _minr = New Rectangle(0, 0, 16, 16)
  114.         _maxr = New Rectangle(16, 0, 16, 16)
  115.         _cr = New Rectangle(32, 0, 16, 16)
  116.         g.FillRectangle(New SolidBrush(Color.FromArgb(255, 255, 240)), _minr)
  117.         g.FillRectangle(New SolidBrush(Color.FromArgb(255, 255, 240)), _maxr)
  118.         g.FillRectangle(New SolidBrush(Color.FromArgb(255, 255, 240)), _cr)
  119.         g.DrawString("0", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _minr, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  120.         If FindForm.WindowState = FormWindowState.Maximized Then
  121.             g.DrawString("2", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _maxr, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  122.         Else
  123.             g.DrawString("1", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _maxr, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  124.         End If
  125.         g.DrawString("r", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _cr, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  126.         'g.Dispose()
  127.     End Sub
  128.  
  129.     Sub New()
  130.         SetStyle(ControlStyles.AllPaintingInWmPaint, True)
  131.         SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
  132.         SetStyle(ControlStyles.UserPaint, True)
  133.         SetStyle(ControlStyles.ResizeRedraw, True)
  134.         Width = 48
  135.         Height = 16
  136.         Anchor = AnchorStyles.Top Or AnchorStyles.Right
  137.     End Sub
  138.  
  139.     Protected Overrides Sub OnResize(ByVal e As EventArgs)
  140.         MyBase.OnResize(e)
  141.         Size = New Size(48, 16)
  142.     End Sub
  143.  
  144.     Protected Overrides Sub OnMouseClick(ByVal e As MouseEventArgs)
  145.         MyBase.OnMouseClick(e)
  146.         If _cr.Contains(e.Location) Then
  147.             FindForm.Close()
  148.         End If
  149.         If _maxr.Contains(e.Location) Then
  150.             If FindForm.WindowState = FormWindowState.Maximized Then
  151.                 FindForm.WindowState = FormWindowState.Normal
  152.                 Invalidate()
  153.             Else
  154.                 FindForm.WindowState = FormWindowState.Maximized
  155.                 Invalidate()
  156.             End If
  157.         End If
  158.         If _minr.Contains(e.Location) Then
  159.             FindForm.WindowState = FormWindowState.Minimized
  160.             Invalidate()
  161.         End If
  162.     End Sub
  163. End Class
  164.  
  165. Public Class SweetStatusStrip : Inherits StatusStrip
  166.     Sub New()
  167.         BackColor = Color.FromArgb(86, 186, 236)
  168.         ForeColor = Color.Ivory
  169.         Font = New Font("Tahoma", 8)
  170.         SizingGrip = False
  171.         SetStyle(ControlStyles.AllPaintingInWmPaint, True)
  172.         SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
  173.         SetStyle(ControlStyles.ResizeRedraw, True)
  174.     End Sub
  175.  
  176.     Protected Sub CreateSss()
  177.         Dim g As Graphics = CreateGraphics()
  178.         g.DrawRectangle(New Pen(Color.FromArgb(150, 150, 150)), New Rectangle(1, 1, Width - 3, Height - 3))
  179.     End Sub
  180.  
  181.     Protected Overrides Sub WndProc(ByRef m As Message)
  182.         If m.Msg = 15 Then
  183.             Invalidate()
  184.             MyBase.WndProc(m)
  185.             CreateSss()
  186.         Else
  187.             MyBase.WndProc(m)
  188.         End If
  189.     End Sub
  190.  
  191.     Protected Overrides Sub CreateHandle()
  192.         MyBase.CreateHandle()
  193.         Dock = DockStyle.Bottom
  194.     End Sub
  195. End Class
  196.  
  197. Public Class SweetLabel : Inherits Label
  198.  
  199.     Sub New()
  200.         BackColor = Color.Transparent
  201.         SetStyle(ControlStyles.AllPaintingInWmPaint, True)
  202.         SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
  203.         SetStyle(ControlStyles.ResizeRedraw, True)
  204.         SetStyle(ControlStyles.SupportsTransparentBackColor, True)
  205.         Font = New Font("Tahoma", 10, FontStyle.Regular)
  206.     End Sub
  207.  
  208.     Protected Overrides Sub OnTextChanged(e As EventArgs)
  209.         MyBase.OnTextChanged(e) : Invalidate()
  210.     End Sub
  211. End Class
  212.  
  213. Public Class SweetPanel : Inherits ContainerControl
  214.  
  215.     Protected Overrides Sub OnResize(ByVal e As EventArgs)
  216.         MyBase.OnResize(e)
  217.         Invalidate()
  218.     End Sub
  219.  
  220.     Sub New()
  221.         MyBase.New()
  222.         Size = New Size(240, 160)
  223.         SetStyle(ControlStyles.AllPaintingInWmPaint, True)
  224.         SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
  225.         SetStyle(ControlStyles.UserPaint, True)
  226.         SetStyle(ControlStyles.ResizeRedraw, True)
  227.     End Sub
  228.  
  229.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  230.         MyBase.OnPaint(e)
  231.         Dim g As Graphics = e.Graphics
  232.         g.SmoothingMode = SmoothingMode.HighQuality
  233.         Dim cr As Rectangle = New Rectangle(0, 0, Width, Height)
  234.         g.FillRectangle(New SolidBrush(Color.FromArgb(86, 186, 236)), cr)
  235.         'g.Dispose()
  236.     End Sub
  237. End Class
  238.  
  239. Public Class SweetGroupBox : Inherits ContainerControl
  240.  
  241.     Protected Overrides Sub OnResize(ByVal e As EventArgs)
  242.         MyBase.OnResize(e)
  243.         Invalidate()
  244.     End Sub
  245.  
  246.     Sub New()
  247.         MyBase.New()
  248.         Size = New Size(240, 160)
  249.         SetStyle(ControlStyles.AllPaintingInWmPaint, True)
  250.         SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
  251.         SetStyle(ControlStyles.UserPaint, True)
  252.         SetStyle(ControlStyles.ResizeRedraw, True)
  253.     End Sub
  254.  
  255.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  256.         MyBase.OnPaint(e)
  257.         Dim g As Graphics = e.Graphics
  258.         g.SmoothingMode = SmoothingMode.HighQuality
  259.         Dim cr As Rectangle = New Rectangle(0, 0, Width, Height)
  260.         Dim cr1 As Rectangle = New Rectangle(1, 1, Width - 2, Height - 2)
  261.         Dim cr2 As Rectangle = New Rectangle(1, 1, Width - 2, 25)
  262.         g.FillRectangle(New SolidBrush(Color.FromArgb(86, 186, 236)), cr)
  263.         g.DrawRectangle(New Pen(Color.Black), cr1)
  264.         g.FillRectangle(New SolidBrush(Color.FromArgb(255, 255, 240)), cr2)
  265.         g.DrawRectangle(New Pen(Color.Black), cr2)
  266.         g.DrawString(Text, New Font("Tahoma", 10, FontStyle.Bold), New SolidBrush(Color.FromArgb(128, 128, 128)), New Rectangle(0, 0, Width - 5, 30), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  267.         'g.Dispose()
  268.     End Sub
  269. End Class
  270.  
  271. Public Class SweetRadioButton : Inherits Control
  272.  
  273.     Private _check As Boolean
  274.  
  275.     Public Property Checked As Boolean
  276.         Get
  277.             Return _check
  278.         End Get
  279.         Set(value As Boolean)
  280.             _check = value
  281.             Invalidate()
  282.         End Set
  283.     End Property
  284.  
  285.     Sub New()
  286.         MyBase.New()
  287.         Size = New Size(160, 20)
  288.         SetStyle(ControlStyles.AllPaintingInWmPaint, True)
  289.         SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
  290.         SetStyle(ControlStyles.UserPaint, True)
  291.         SetStyle(ControlStyles.ResizeRedraw, True)
  292.         SetStyle(ControlStyles.Selectable, False)
  293.     End Sub
  294.  
  295.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  296.         MyBase.OnPaint(e)
  297.         Dim g As Graphics = e.Graphics
  298.         Dim cr As Rectangle = New Rectangle(0, 0, Width, Height)
  299.         Dim cr1 As Rectangle = New Rectangle(2, 2, 15, 15)
  300.         g.FillRectangle(New SolidBrush(Color.FromArgb(86, 186, 236)), cr)
  301.         g.FillEllipse(New SolidBrush(Color.FromArgb(255, 255, 240)), cr1)
  302.         g.DrawString(Text, New Font("Tahoma", 10, FontStyle.Bold), New SolidBrush(Color.FromArgb(255, 255, 255)), New Rectangle(10, 5, Width, 10), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  303.         If Checked Then
  304.             cr1.Inflate(-2, -2)
  305.             g.FillEllipse(New SolidBrush(Color.FromArgb(0, 0, 0)), cr1)
  306.         Else
  307.             g.FillEllipse(New SolidBrush(Color.FromArgb(255, 255, 240)), cr1)
  308.         End If
  309.     End Sub
  310.  
  311.     Protected Overrides Sub OnTextChanged(ByVal e As EventArgs)
  312.         MyBase.OnTextChanged(e)
  313.         Invalidate()
  314.     End Sub
  315.  
  316.     Protected Overrides Sub OnClick(ByVal e As EventArgs)
  317.         MyBase.OnClick(e)
  318.         If Not Checked Then Checked = True
  319.         For Each ctrl As Control In Parent.Controls
  320.             If TypeOf ctrl Is SweetRadioButton Then
  321.                 If ctrl.Handle = Handle Then Continue For
  322.                 If ctrl.Enabled Then DirectCast(ctrl, SweetRadioButton).Checked = False
  323.             End If
  324.         Next
  325.     End Sub
  326. End Class
  327.  
  328. Public Class SweetCheckBox : Inherits Control
  329.  
  330.     Private _check As Boolean
  331.  
  332.     Public Property Checked As Boolean
  333.         Get
  334.             Return _check
  335.         End Get
  336.         Set(value As Boolean)
  337.             _check = value
  338.             Invalidate()
  339.         End Set
  340.     End Property
  341.  
  342.     Sub New()
  343.         MyBase.New()
  344.         Size = New Size(160, 20)
  345.         SetStyle(ControlStyles.AllPaintingInWmPaint, True)
  346.         SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
  347.         SetStyle(ControlStyles.UserPaint, True)
  348.         SetStyle(ControlStyles.ResizeRedraw, True)
  349.         SetStyle(ControlStyles.Selectable, False)
  350.     End Sub
  351.  
  352.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  353.         MyBase.OnPaint(e)
  354.         Dim g As Graphics = e.Graphics
  355.         Dim cr As Rectangle = New Rectangle(0, 0, Width, Height)
  356.         Dim cr1 As Rectangle = New Rectangle(3, 3, 14, 14)
  357.         g.FillRectangle(New SolidBrush(Color.FromArgb(86, 186, 236)), cr)
  358.         g.FillRectangle(New SolidBrush(Color.FromArgb(255, 255, 240)), cr1)
  359.         g.DrawString(Text, New Font("Tahoma", 10, FontStyle.Bold), New SolidBrush(Color.FromArgb(255, 255, 255)), New Rectangle(10, 5, Width, 10), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  360.         If Checked Then
  361.             g.DrawString("b", New Font("Marlett", 10, FontStyle.Bold), New SolidBrush(Color.FromArgb(0, 0, 0)), cr1, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  362.         End If
  363.     End Sub
  364.  
  365.     Protected Overrides Sub OnTextChanged(ByVal e As EventArgs)
  366.         MyBase.OnTextChanged(e)
  367.         Invalidate()
  368.     End Sub
  369.  
  370.     Protected Overrides Sub OnClick(ByVal e As EventArgs)
  371.         MyBase.OnClick(e)
  372.         If Not Checked Then Checked = True Else Checked = False
  373.     End Sub
  374. End Class
  375.  
  376. Public Class SweetToggle : Inherits Control
  377.  
  378.     Private _check As Boolean
  379.  
  380.     Public Property Checked As Boolean
  381.         Get
  382.             Return _check
  383.         End Get
  384.         Set(value As Boolean)
  385.             _check = value
  386.             Invalidate()
  387.         End Set
  388.     End Property
  389.  
  390.     Sub New()
  391.         MyBase.New()
  392.         Size = New Size(80, 25)
  393.         SetStyle(ControlStyles.AllPaintingInWmPaint, True)
  394.         SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
  395.         SetStyle(ControlStyles.UserPaint, True)
  396.         SetStyle(ControlStyles.ResizeRedraw, True)
  397.         SetStyle(ControlStyles.Selectable, False)
  398.     End Sub
  399.  
  400.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  401.         MyBase.OnPaint(e)
  402.         Dim g As Graphics = e.Graphics
  403.         Dim cr As Rectangle = New Rectangle(0, 0, Width, Height)
  404.         g.FillRectangle(New SolidBrush(Color.FromArgb(86, 186, 236)), cr)
  405.         If Checked Then
  406.             g.FillRectangle(New SolidBrush(Color.FromArgb(222, 184, 135)), New Rectangle(CInt((Width / 2) - 2), 2, CInt((Width / 2)), Height - 4))
  407.             g.DrawString("ON", New Font("Tahoma", 10, FontStyle.Bold), New SolidBrush(Color.FromArgb(255, 255, 255)), New Rectangle(0, 5, CInt((Width / 2)), 15), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  408.             g.DrawLine(New Pen(Color.Black), 56, 5, 56, Height - 7)
  409.             g.DrawLine(New Pen(Color.Black), 58, 3, 58, Height - 5)
  410.             g.DrawLine(New Pen(Color.Black), 60, 5, 60, Height - 7)
  411.         Else
  412.             g.FillRectangle(New SolidBrush(Color.FromArgb(222, 184, 135)), New Rectangle(2, 2, CInt((Width / 2)), Height - 4))
  413.             g.DrawString("OFF", New Font("Tahoma", 10, FontStyle.Bold), New SolidBrush(Color.FromArgb(255, 255, 255)), New Rectangle(CInt((Width / 2)), 5, CInt((Width / 2)), 15), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  414.             g.DrawLine(New Pen(Color.Black), 20, 5, 20, Height - 7)
  415.             g.DrawLine(New Pen(Color.Black), 22, 3, 22, Height - 5)
  416.             g.DrawLine(New Pen(Color.Black), 24, 5, 24, Height - 7)
  417.         End If
  418.     End Sub
  419.  
  420.     Protected Overrides Sub OnTextChanged(ByVal e As EventArgs)
  421.         MyBase.OnTextChanged(e)
  422.         Invalidate()
  423.     End Sub
  424.  
  425.     Protected Overrides Sub OnClick(ByVal e As EventArgs)
  426.         MyBase.OnClick(e)
  427.         If Not Checked Then Checked = True Else Checked = False
  428.     End Sub
  429. End Class
  430.  
  431. Public Class SweetButton : Inherits Control
  432.  
  433.     Enum MouseState As Byte
  434.         None = 0
  435.         Over = 1
  436.         Down = 2
  437.     End Enum
  438.  
  439.     Dim _state As MouseState
  440.  
  441.     Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  442.         MyBase.OnMouseDown(e)
  443.         _state = MouseState.Down
  444.         Invalidate()
  445.     End Sub
  446.  
  447.     Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs)
  448.         MyBase.OnMouseUp(e)
  449.         _state = MouseState.Over
  450.         Invalidate()
  451.     End Sub
  452.  
  453.     Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs)
  454.         MyBase.OnMouseEnter(e)
  455.         _state = MouseState.Over
  456.         Invalidate()
  457.     End Sub
  458.  
  459.     Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs)
  460.         MyBase.OnMouseLeave(e)
  461.         _state = MouseState.None
  462.         Invalidate()
  463.     End Sub
  464.  
  465.     Sub New()
  466.         SetStyle(ControlStyles.AllPaintingInWmPaint, True)
  467.         SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
  468.         SetStyle(ControlStyles.UserPaint, True)
  469.         SetStyle(ControlStyles.ResizeRedraw, True)
  470.         Size = New Size(125, 30)
  471.         _state = MouseState.None
  472.     End Sub
  473.  
  474.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  475.         MyBase.OnPaint(e)
  476.         Dim g As Graphics = e.Graphics
  477.         g.SmoothingMode = SmoothingMode.HighQuality
  478.         Dim cr As Rectangle = New Rectangle(0, 0, Width, Height)
  479.         Dim cr1 As Rectangle = New Rectangle(2, 2, Width - 4, Height - 4)
  480.         g.FillRectangle(New SolidBrush(Color.FromArgb(86, 186, 236)), cr)
  481.         Dim btnfont As New Font("Tahoma", 10, FontStyle.Bold)
  482.         Select Case _state
  483.             Case MouseState.None
  484.                 g.DrawString(Text, btnfont, Brushes.White, New Rectangle(0, 0, Width, Height), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  485.             Case MouseState.Down
  486.                 g.FillRectangle(New SolidBrush(Color.FromArgb(222, 184, 135)), cr1)
  487.                 g.DrawString(Text, btnfont, Brushes.Blue, New Rectangle(0, 0, Width, Height), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  488.             Case MouseState.Over
  489.                 g.FillRectangle(New SolidBrush(Color.FromArgb(222, 184, 135)), cr1)
  490.                 g.DrawString(Text, btnfont, Brushes.Black, New Rectangle(0, 0, Width, Height), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  491.         End Select
  492.         'g.Dispose()
  493.     End Sub
  494. End Class
Advertisement
Add Comment
Please, Sign In to add comment