LordPankake

[VB.net] Piano ElementsTheme - [11 Controls | Dark]

Nov 1st, 2014
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System.Drawing.Drawing2D
  2. '|===========================================================|
  3. '|===|  Piano Elements
  4. '| Creator: LordPankake
  5. '| HF Account: http://www.hackforums.net/member.php?action=profile&uid=1828119
  6. '| Created: 9/25/2014, Last edited: 11/2/2014
  7. '|          Wow, school made this take forever
  8. '|===========================================================|
  9. #Region "Base Classes"
  10. Public Class ThemedControl : Inherits Control
  11.     Public D As New DrawUtils
  12.     Public State As MouseState = MouseState.None
  13.     Public Pal As Palette
  14.     Protected Overrides Sub OnPaintBackground(ByVal e As System.Windows.Forms.PaintEventArgs)
  15.     End Sub
  16.     Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs)
  17.         MyBase.OnMouseEnter(e)
  18.         State = MouseState.Over
  19.         Invalidate()
  20.     End Sub
  21.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  22.         MyBase.OnMouseDown(e)
  23.         State = MouseState.Down
  24.         Invalidate()
  25.     End Sub
  26.     Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs)
  27.         MyBase.OnMouseLeave(e)
  28.         State = MouseState.None
  29.         Invalidate()
  30.     End Sub
  31.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  32.         MyBase.OnMouseUp(e)
  33.         State = MouseState.Over
  34.         Invalidate()
  35.     End Sub
  36.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  37.         MyBase.OnTextChanged(e)
  38.         Invalidate()
  39.     End Sub
  40.     Sub New()
  41.         MyBase.New()
  42.         MinimumSize = New Size(20, 19)
  43.         ForeColor = Color.FromArgb(146, 149, 152)
  44.         Font = New Font("Segoe UI", 10.0F)
  45.         DoubleBuffered = True
  46.         Pal = New Palette
  47.         Pal.ColHighest = Color.FromArgb(150, 150, 150)
  48.         Pal.ColHigh = Color.FromArgb(63, 63, 63)
  49.         Pal.ColMed = Color.FromArgb(35, 35, 35)
  50.         Pal.ColDim = Color.FromArgb(16, 16, 16)
  51.         Pal.ColDark = Color.FromArgb(5, 5, 5)
  52.         BackColor = Pal.ColMed
  53.     End Sub
  54. End Class
  55. Public Class ThemedTextbox : Inherits TextBox
  56.     Public D As New DrawUtils
  57.     Public State As MouseState = MouseState.None
  58.     Public Pal As Palette
  59.     Protected Overrides Sub OnPaintBackground(ByVal e As System.Windows.Forms.PaintEventArgs)
  60.     End Sub
  61.     Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs)
  62.         MyBase.OnMouseEnter(e)
  63.         State = MouseState.Over
  64.         Invalidate()
  65.     End Sub
  66.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  67.         MyBase.OnMouseDown(e)
  68.         State = MouseState.Down
  69.         Invalidate()
  70.     End Sub
  71.     Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs)
  72.         MyBase.OnMouseLeave(e)
  73.         State = MouseState.None
  74.         Invalidate()
  75.     End Sub
  76.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  77.         MyBase.OnMouseUp(e)
  78.         State = MouseState.Over
  79.         Invalidate()
  80.     End Sub
  81.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  82.         MyBase.OnTextChanged(e)
  83.         Invalidate()
  84.     End Sub
  85.     Sub New()
  86.         MyBase.New()
  87.         MinimumSize = New Size(20, 20)
  88.         ForeColor = Color.FromArgb(146, 149, 152)
  89.         Font = New Font("Segoe UI", 10.0F)
  90.         DoubleBuffered = True
  91.         Pal = New Palette
  92.         Pal.ColHighest = Color.FromArgb(150, 150, 150)
  93.         Pal.ColHigh = Color.FromArgb(63, 63, 63)
  94.         Pal.ColMed = Color.FromArgb(35, 35, 35)
  95.         Pal.ColDim = Color.FromArgb(16, 16, 16)
  96.         Pal.ColDark = Color.FromArgb(5, 5, 5)
  97.         BackColor = Pal.ColMed
  98.     End Sub
  99. End Class
  100. Public Class ThemedContainer : Inherits ContainerControl
  101.     Public D As New DrawUtils
  102.     Public Property Sizable As Boolean = True
  103.     Protected Drag As Boolean = True
  104.     Public State As MouseState = MouseState.None
  105.     Protected TopCap As Boolean = False
  106.     Protected SizeCap As Boolean = False
  107.     Public Pal As Palette
  108.     Protected MouseP As Point = New Point(0, 0)
  109.     Protected TopGrip As Integer
  110.     Protected Overrides Sub OnPaintBackground(ByVal e As System.Windows.Forms.PaintEventArgs)
  111.     End Sub
  112.     Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs)
  113.         MyBase.OnMouseEnter(e)
  114.         State = MouseState.Over
  115.         Invalidate()
  116.     End Sub
  117.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  118.         MyBase.OnMouseDown(e)
  119.         State = MouseState.Down
  120.         If e.Button = Windows.Forms.MouseButtons.Left Then
  121.             If New Rectangle(0, 0, Width, TopGrip).Contains(e.Location) Then
  122.                 TopCap = True : MouseP = e.Location
  123.             ElseIf Drag And New Rectangle(Width - 15, Height - 15, 15, 15).Contains(e.Location) Then
  124.                 SizeCap = True : MouseP = e.Location
  125.             End If
  126.         End If
  127.     End Sub
  128.     Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs)
  129.         MyBase.OnMouseLeave(e)
  130.         State = MouseState.None
  131.         Invalidate()
  132.     End Sub
  133.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  134.         MyBase.OnMouseUp(e)
  135.         State = MouseState.Over
  136.         TopCap = False
  137.         If Drag Then
  138.             SizeCap = False
  139.         End If
  140.  
  141.     End Sub
  142.     Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)
  143.         MyBase.OnMouseMove(e)
  144.  
  145.         If TopCap Then
  146.             Parent.Location = MousePosition - MouseP
  147.         End If
  148.         If Sizable And Drag And SizeCap Then
  149.             MouseP = e.Location
  150.             Parent.Size = New Size(MouseP)
  151.             Invalidate()
  152.         End If
  153.  
  154.     End Sub
  155.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  156.         MyBase.OnTextChanged(e)
  157.         Invalidate()
  158.     End Sub
  159.     Sub New()
  160.         MyBase.New()
  161.         MinimumSize = New Size(20, 20)
  162.         ForeColor = Color.FromArgb(146, 149, 152)
  163.         Font = New Font("Trebuchet MS", 10.0F)
  164.         DoubleBuffered = True
  165.         Pal = New Palette
  166.         Pal.ColHighest = Color.FromArgb(150, 150, 150)
  167.         Pal.ColHigh = Color.FromArgb(63, 63, 63)
  168.         Pal.ColMed = Color.FromArgb(35, 35, 35)
  169.         Pal.ColDim = Color.FromArgb(16, 16, 16)
  170.         Pal.ColDark = Color.FromArgb(5, 5, 5)
  171.         BackColor = Pal.ColMed
  172.     End Sub
  173. End Class
  174. #End Region
  175.  
  176. #Region "Theme"
  177. Public Class PEForm : Inherits ThemedContainer
  178.     Public Property TextYOffset As Integer = 0
  179.     Public Property TextGradTopScale As Double = 1
  180.     Public Property TextGradBottomScale As Double = 1
  181.     Sub New()
  182.         MyBase.New()
  183.         MinimumSize = New Size(305, 150)
  184.         Dock = DockStyle.Fill
  185.         TopGrip = 70
  186.         Font = New Font("Segoe UI Semibold", 35)
  187.         BackColor = Color.FromArgb(21, 23, 25)
  188.         ForeColor = Color.FromArgb(160, Color.White)
  189.     End Sub
  190.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  191.         Dim G As Graphics = e.Graphics
  192.         MyBase.OnPaint(e)
  193.         Try
  194.             Me.ParentForm.TransparencyKey = Color.Fuchsia
  195.             Me.ParentForm.MinimumSize = MinimumSize
  196.             If Not Me.ParentForm.FormBorderStyle = FormBorderStyle.None Then
  197.                 Me.ParentForm.FormBorderStyle = FormBorderStyle.None
  198.             End If
  199.         Catch ex As Exception : End Try
  200.         G.Clear(Me.ParentForm.TransparencyKey)
  201.  
  202.         '| Main/basic body
  203.        Dim FormRoundness As Integer = 8
  204.         Dim MainRect As New Rectangle(0, 0, Width, Height)
  205.         Dim MainRectBorder As New Rectangle(0, 0, Width - 1, Height - 1)
  206.         Dim MainPath As GraphicsPath = D.RoundRect(MainRect, FormRoundness)
  207.         Dim MainPathBorder As GraphicsPath = D.RoundRect(MainRectBorder, FormRoundness)
  208.         G.FillPath(New SolidBrush(Pal.ColMed), MainPath)
  209.         G.DrawPath(New Pen(Pal.ColMed), MainPathBorder)
  210.         G.SmoothingMode = SmoothingMode.HighQuality
  211.         G.DrawPath(New Pen(Color.FromArgb(20, Pal.ColHighest)), D.RoundRect(New Rectangle(1, 1, Width - 3, Height - 3), FormRoundness))
  212.         '|=========| Top grip area |START|
  213.        Dim CenterOffset As Integer = Width / 3
  214.         Dim PathObjHeight As Integer = TopGrip / 3
  215.         Dim TexturePath As New GraphicsPath
  216.         Dim PathCutoffScaler As Double = 2.15
  217.         With TexturePath
  218.             .AddPolygon({
  219.                         New Point(-2, PathObjHeight),
  220.                         New Point(Width, PathObjHeight),
  221.                         New Point(Width, PathObjHeight * PathCutoffScaler),
  222.                         New Point((Width / 2) + CenterOffset, PathObjHeight * PathCutoffScaler),
  223.                         New Point((Width / 2) + CenterOffset - 10, PathObjHeight * 3),
  224.                         New Point((Width / 2) - CenterOffset + 10, PathObjHeight * 3),
  225.                         New Point((Width / 2) - CenterOffset, PathObjHeight * PathCutoffScaler),
  226.                         New Point(-2, PathObjHeight * PathCutoffScaler)})
  227.         End With
  228.         G.FillPath(New SolidBrush(Pal.ColDim), TexturePath)
  229.         '| Shine behind the textures
  230.        Dim CircleRect As New Rectangle((Width / 2) - CenterOffset * (2 / 3), PathObjHeight, (CenterOffset * (2 / 3)) * 2, PathObjHeight * 2)
  231.         Dim CirclePath As New GraphicsPath : CirclePath.AddEllipse(CircleRect)
  232.         Dim CircleGB As New PathGradientBrush(CirclePath)
  233.         CircleGB.CenterPoint = New PointF(Width / 2, PathObjHeight + (PathObjHeight))
  234.         CircleGB.CenterColor = Color.FromArgb(10, Color.White)
  235.         CircleGB.SurroundColors = New Color() {Color.Transparent}
  236.         G.FillEllipse(CircleGB, CircleRect)
  237.         D.FillDualGradPath(G, Color.FromArgb(20, Color.Black), Color.FromArgb(5, Color.White), New Rectangle(0, 0, Width, TopGrip), TexturePath, GradientAlignment.Vertical)
  238.         '| The texture overlay
  239.        Dim TexturePathHB As New TextureBrush(New Bitmap(D.CodeToImage(D.Texture)))
  240.         G.FillPath(TexturePathHB, TexturePath)
  241.         G.DrawPath(New Pen(Color.FromArgb(Pal.ColDark.R + 10, Pal.ColDark.R + 10, Pal.ColDark.R + 13)), TexturePath)
  242.         'G.DrawPath(New Pen(Color.Red, 5), TextPath)
  243.        '|=========| Top grip area |END|
  244.        '|=========| Top grip shines |START|
  245.        Dim ShineLGBMid As LinearGradientBrush
  246.         Dim ShineLGBMidShadow As LinearGradientBrush
  247.         Dim ColBlend As New ColorBlend()
  248.         '| Top Middle Shine
  249.        ShineLGBMid = New LinearGradientBrush(New Point(0, 0), New Point(Width, 0), Color.Transparent, Color.Transparent)
  250.         ShineLGBMidShadow = New LinearGradientBrush(New Point(0, 0), New Point(Width, 0), Color.Transparent, Color.Transparent)
  251.         ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(100, Pal.ColHighest), Color.Transparent} : ShineLGBMid.InterpolationColors = ColBlend
  252.         ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.FromArgb(25, Pal.ColDark), Color.FromArgb(200, Pal.ColDark), Color.FromArgb(25, Pal.ColDark)} : ShineLGBMidShadow.InterpolationColors = ColBlend
  253.         G.DrawLine(New Pen(ShineLGBMid), New Point(0, PathObjHeight - 1), New Point(Width, PathObjHeight - 1))
  254.         G.DrawLine(New Pen(ShineLGBMidShadow), New Point(0, PathObjHeight), New Point(Width, PathObjHeight))
  255.         '| Bottom middle shine
  256.        ShineLGBMid = New LinearGradientBrush(New Point((Width / 2) - CenterOffset, 0), New Point((Width / 2) + CenterOffset - 10, 0), Color.Transparent, Color.Transparent)
  257.         ShineLGBMidShadow = New LinearGradientBrush(New Point((Width / 2) - CenterOffset, 0), New Point((Width / 2) + CenterOffset - 10, 0), Color.Transparent, Color.Transparent)
  258.         ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(150, Pal.ColHighest), Color.Transparent} : ShineLGBMid.InterpolationColors = ColBlend
  259.         ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.FromArgb(25, Pal.ColDark), Color.FromArgb(200, Pal.ColDark), Color.FromArgb(25, Pal.ColDark)} : ShineLGBMidShadow.InterpolationColors = ColBlend
  260.         G.DrawLine(New Pen(ShineLGBMid), New Point((Width / 2) - CenterOffset + 10, PathObjHeight * 3 + 1), New Point((Width / 2) + CenterOffset - 10, PathObjHeight * 3 + 1))
  261.         G.DrawLine(New Pen(ShineLGBMidShadow), New Point((Width / 2) - CenterOffset + 10, PathObjHeight * 3 + 2), New Point((Width / 2) + CenterOffset - 10, PathObjHeight * 3 + 2))
  262.         '| Left shine
  263.        ShineLGBMid = New LinearGradientBrush(New Point(0, 0), New Point((Width / 2) - CenterOffset, 0), Color.Transparent, Color.Transparent)
  264.         ShineLGBMidShadow = New LinearGradientBrush(New Point(0, 0), New Point((Width / 2) - CenterOffset, 0), Color.Transparent, Color.Transparent)
  265.         ColBlend.Positions = {0, 9 / 10, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(85, Pal.ColHighest), Color.Transparent} : ShineLGBMid.InterpolationColors = ColBlend
  266.         ColBlend.Positions = {0, 9 / 10, 1} : ColBlend.Colors = {Color.FromArgb(25, Pal.ColDark), Color.FromArgb(110, Pal.ColDark), Color.FromArgb(25, Pal.ColDark)} : ShineLGBMidShadow.InterpolationColors = ColBlend
  267.         G.DrawLine(New Pen(ShineLGBMid), New Point(0, PathObjHeight * PathCutoffScaler + 1), New Point((Width / 2) - CenterOffset, PathObjHeight * PathCutoffScaler + 1))
  268.         G.DrawLine(New Pen(ShineLGBMidShadow), New Point(0, PathObjHeight * PathCutoffScaler + 2), New Point((Width / 2) - CenterOffset, PathObjHeight * PathCutoffScaler + 2))
  269.         '| Right shine
  270.        ShineLGBMid = New LinearGradientBrush(New Point((Width / 2) + CenterOffset, 0), New Point(Width - 1, 0), Color.Transparent, Color.Transparent)
  271.         ShineLGBMidShadow = New LinearGradientBrush(New Point((Width / 2) + CenterOffset, 0), New Point(Width - 1, 0), Color.Transparent, Color.Transparent)
  272.         ColBlend.Positions = {0, 1 / 10, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(85, Pal.ColHighest), Color.Transparent} : ShineLGBMid.InterpolationColors = ColBlend
  273.         ColBlend.Positions = {0, 1 / 10, 1} : ColBlend.Colors = {Color.FromArgb(25, Pal.ColDark), Color.FromArgb(110, Pal.ColDark), Color.FromArgb(25, Pal.ColDark)} : ShineLGBMidShadow.InterpolationColors = ColBlend
  274.         G.DrawLine(New Pen(ShineLGBMid), New Point((Width / 2) + CenterOffset, PathObjHeight * PathCutoffScaler + 1), New Point(Width - 1, PathObjHeight * PathCutoffScaler + 1))
  275.         G.DrawLine(New Pen(ShineLGBMidShadow), New Point((Width / 2) + CenterOffset, PathObjHeight * PathCutoffScaler + 2), New Point(Width - 1, PathObjHeight * PathCutoffScaler + 2))
  276.         '|=========| Top grip shines |END|
  277.        '|=========| Text rendering |START|
  278.        Dim TextPath As New GraphicsPath
  279.         Dim StrFormat As New StringFormat
  280.         StrFormat.LineAlignment = StringAlignment.Center
  281.         StrFormat.Alignment = StringAlignment.Center
  282.         Dim TextSize As Size = G.MeasureString(Text, Font).ToSize
  283.         With TextPath
  284.             .AddString(Text, Font.FontFamily, Font.Style, Font.Size, New Point((Width / 2), PathObjHeight * 2 + TextYOffset), StrFormat)
  285.         End With
  286.         G.DrawPath(New Pen(Color.FromArgb(100, 100, 255, 0), 5), TextPath)
  287.         For i As Integer = 5 To 1 Step -1
  288.             G.DrawPath(New Pen(Color.FromArgb(90, Color.Black), i), TextPath)
  289.         Next
  290.         Dim TextPathLGB As New LinearGradientBrush(New Point(0, ((PathObjHeight * 2) - (PathObjHeight / 2) - TextYOffset) * TextGradTopScale), New Point(0, ((PathObjHeight * 2) + (PathObjHeight / 2) + 3 + TextYOffset) * TextGradBottomScale), Color.FromArgb(180, 255, 20), Color.FromArgb(60, 180, 20))
  291.         G.FillPath(TextPathLGB, TextPath)
  292.         '|=========| Text rendering |STOP|
  293.        '|=========| Border
  294.        G.SmoothingMode = SmoothingMode.None
  295.         G.DrawPath(New Pen(Color.FromArgb(100, Pal.ColDark)), MainPathBorder)
  296.     End Sub
  297. End Class
  298. Public Class PEControlButton : Inherits ThemedControl
  299.     Public Property ButtonColor As Color = Nothing
  300.     Sub New()
  301.         MyBase.New()
  302.         Font = New Font("Segoe UI", 11.0F)
  303.         MinimumSize = New Size(11, 11)
  304.     End Sub
  305.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  306.         Dim G As Graphics = e.Graphics
  307.         MyBase.OnPaint(e)
  308.         G.Clear(Me.BackColor)
  309.         Size = New Size(16, 16)
  310.  
  311.         Dim Image As Bitmap = D.CodeToImage(D.Texture2)
  312.         G.SmoothingMode = SmoothingMode.HighQuality
  313.         Dim ColorRec2t As New Rectangle(0, 0, Image.Width - 1, Image.Height - 1)
  314.         G.DrawEllipse(New Pen(Color.FromArgb(60, Color.Black)), ColorRec2t)
  315.  
  316.         If Not IsNothing(ButtonColor) Then
  317.             Dim ColorRect As New Rectangle(1, 1, Image.Width - 3, Image.Height - 3)
  318.             Select Case State
  319.                 Case MouseState.None
  320.                     G.FillEllipse(New SolidBrush(Color.FromArgb(100, ButtonColor)), ColorRect)
  321.                 Case MouseState.Over
  322.                     G.FillEllipse(New SolidBrush(Color.FromArgb(150, ButtonColor)), ColorRect)
  323.                 Case MouseState.Down
  324.                     G.FillEllipse(New SolidBrush(Color.FromArgb(50, ButtonColor)), ColorRect)
  325.             End Select
  326.         End If
  327.  
  328.         G.DrawImage(Image, New Point(0, 0))
  329.     End Sub
  330. End Class
  331. Public Class PEButtonAlt : Inherits ThemedControl
  332.     Public Property Rounded As Boolean = True
  333.     Sub New()
  334.         MyBase.New()
  335.         Font = New Font("Segoe UI", 10.0F)
  336.         ForeColor = Pal.ColHighest
  337.     End Sub
  338.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  339.         Dim G As Graphics = e.Graphics
  340.         MyBase.OnPaint(e)
  341.         G.Clear(Me.BackColor)
  342.  
  343.         Dim Roundness As Integer = 5
  344.         Dim FillRect As New Rectangle(0, 0, Width - 1, Height - 1)
  345.         Dim HighlightRect As New Rectangle(1, 1, Width - 2, Height - 2)
  346.         Dim ShadowRect As New Rectangle(1, 1, Width - 3, Height - 3)
  347.         Dim FillLGB As New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(Pal.ColMed.R + 10, Pal.ColMed.R + 10, Pal.ColMed.R + 10), Color.FromArgb(Pal.ColMed.R - 10, Pal.ColMed.R - 10, Pal.ColMed.R - 10))
  348.         If Rounded Then
  349.             Dim FillPath As GraphicsPath = D.RoundRect(FillRect, Roundness)
  350.             Dim HighlightPath As GraphicsPath = D.RoundRect(HighlightRect, Roundness)
  351.             Dim ShadowPath As GraphicsPath = D.RoundRect(ShadowRect, Roundness)
  352.             G.SmoothingMode = SmoothingMode.HighQuality
  353.             G.FillPath(FillLGB, FillPath)
  354.      
  355.             G.DrawPath(New Pen(Pal.ColDim), ShadowPath)
  356.             G.DrawPath(New Pen(Color.FromArgb(160, Pal.ColHigh)), HighlightPath)
  357.             G.DrawPath(New Pen(Pal.ColDark), FillPath)
  358.             '| Shine
  359.            Dim ColBlend As New ColorBlend()
  360.             Dim ShineLGBMid As New LinearGradientBrush(New Point(Roundness, 0), New Point(Width - Roundness - 1, 0), Color.Transparent, Color.Transparent)
  361.             Dim ShineLGBMid2 As New LinearGradientBrush(New Point(Roundness, 0), New Point(Width - Roundness - 1, 0), Color.Transparent, Color.Transparent)
  362.             ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(150, Pal.ColHighest), Color.Transparent} : ShineLGBMid.InterpolationColors = ColBlend
  363.             ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(150, Pal.ColDark), Color.Transparent} : ShineLGBMid2.InterpolationColors = ColBlend
  364.             G.DrawLine(New Pen(ShineLGBMid), New Point(Roundness, 1), New Point(Width - Roundness - 1, 1))
  365.             G.DrawLine(New Pen(ShineLGBMid2), New Point(Roundness, 2), New Point(Width - Roundness - 1, 2))
  366.             If State = MouseState.Over Then
  367.                 G.FillPath(New SolidBrush(Color.FromArgb(13, Color.WhiteSmoke)), FillPath)
  368.             ElseIf State = MouseState.Down Then
  369.                 G.FillPath(New SolidBrush(Color.FromArgb(76, Color.Black)), FillPath)
  370.             End If
  371.         Else
  372.             G.FillRectangle(FillLGB, FillRect)
  373.             G.DrawRectangle(New Pen(Pal.ColDim), ShadowRect)
  374.             G.DrawRectangle(New Pen(Color.FromArgb(160, Pal.ColHigh)), HighlightRect)
  375.             G.DrawRectangle(New Pen(Pal.ColDark), FillRect)
  376.             '| Shine
  377.            Dim ColBlend As New ColorBlend()
  378.             Dim ShineLGBMid As New LinearGradientBrush(New Point(1, 0), New Point(Width - 3, 0), Color.Transparent, Color.Transparent)
  379.             Dim ShineLGBMid2 As New LinearGradientBrush(New Point(1, 0), New Point(Width - 3, 0), Color.Transparent, Color.Transparent)
  380.             ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(150, Pal.ColHighest), Color.Transparent} : ShineLGBMid.InterpolationColors = ColBlend
  381.             ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(150, Pal.ColDark), Color.Transparent} : ShineLGBMid2.InterpolationColors = ColBlend
  382.             G.DrawLine(New Pen(ShineLGBMid), New Point(1, 1), New Point(Width - 3, 1))
  383.             G.DrawLine(New Pen(ShineLGBMid2), New Point(1, 2), New Point(Width - 3, 2))
  384.             If State = MouseState.Over Then
  385.                 G.FillRectangle(New SolidBrush(Color.FromArgb(13, Color.WhiteSmoke)), FillRect)
  386.             ElseIf State = MouseState.Down Then
  387.                 G.FillRectangle(New SolidBrush(Color.FromArgb(76, Color.Black)), FillRect)
  388.             End If
  389.         End If
  390.         D.DrawText(G, FillRect, Text, Font, HorizontalAlignment.Center, ForeColor)
  391.     End Sub
  392. End Class
  393. Public Class PEProgressBar : Inherits ThemedControl
  394.     Private PValue As Integer = 50
  395.     Public Property Rounded As Boolean = True
  396.     Public Property DisplayMode As PEProgressBar.Type = Type.Ticked
  397.     Public Property Value() As Integer
  398.         Get
  399.             Return PValue
  400.         End Get
  401.         Set(ByVal value As Integer)
  402.             PValue = value
  403.             Invalidate()
  404.         End Set
  405.     End Property
  406.     Public Property Minimum As Integer = 0
  407.     Public Property Maximum As Integer = 100
  408.     Public Property TickWidth = 5
  409.     Public Property TickStart = 2
  410.     Sub New()
  411.         MyBase.New()
  412.         Font = New Font("Segoe UI", 11.0F)
  413.         Height = 24
  414.  
  415.     End Sub
  416.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  417.         Dim G As Graphics = e.Graphics
  418.         MyBase.OnPaint(e)
  419.         G.Clear(Me.BackColor)
  420.         Dim blackness As Integer = 100
  421.         Dim roundness As Integer = 3
  422.         If Rounded Then
  423.             G.SmoothingMode = SmoothingMode.HighQuality
  424.         End If
  425.         If DisplayMode = Type.Full Then
  426.             Dim MainRect As New Rectangle(0, 0, Width - 1, Height - 1)
  427.             Dim Value As Integer = ValueToPercentage(PValue) * Width - 1
  428.             Dim ValueRect As New Rectangle(0, 0, Value, Height - 1)
  429.             If Value > 0 Then
  430.                 If Rounded Then
  431.                     G.FillPath(New SolidBrush(Color.FromArgb(blackness, Color.Black)), D.RoundRect(MainRect, roundness))
  432.                     G.FillPath(New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(200, 255, 2), Color.FromArgb(121, 172, 2)), D.RoundRect(ValueRect, roundness))
  433.                     G.DrawPath(New Pen(New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(111, Color.Black), Color.FromArgb(111, Color.Black))), D.RoundRect(New Rectangle(0, 1, Value, Height - 3), 1))
  434.                 Else
  435.                     G.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), MainRect)
  436.                     G.FillRectangle(New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(200, 255, 2), Color.FromArgb(121, 172, 2)), ValueRect)
  437.                 End If
  438.             End If
  439.             If Rounded Then
  440.                 G.DrawPath(New Pen(Pal.ColDark), D.RoundRect(MainRect, roundness))
  441.             Else
  442.                 G.DrawRectangle(New Pen(Pal.ColDark), MainRect)
  443.             End If
  444.         ElseIf DisplayMode = Type.Ticked Then
  445.             Dim MainRect As New Rectangle(0, 0, Width - 1, Height - 6)
  446.             Dim Value As Integer = ValueToPercentage(PValue) * Width - 1
  447.             Dim ValueRect As New Rectangle(0, 0, Value, Height - 6)
  448.             If Value > 0 Then
  449.                 If Rounded Then
  450.                     G.FillPath(New SolidBrush(Color.FromArgb(blackness, Color.Black)), D.RoundRect(MainRect, roundness))
  451.                     G.FillPath(New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(200, 255, 2), Color.FromArgb(121, 172, 2)), D.RoundRect(ValueRect, roundness))
  452.                     G.DrawPath(New Pen(New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(111, Color.Black), Color.FromArgb(111, Color.Black))), D.RoundRect(New Rectangle(0, 1, Value, Height - 8), 1))
  453.                 Else
  454.                     G.FillRectangle(New SolidBrush(Color.FromArgb(30, Color.Black)), MainRect)
  455.                     G.FillRectangle(New LinearGradientBrush(New Point(0, 0), New Point(0, Height - 6), Color.FromArgb(200, 255, 2), Color.FromArgb(121, 172, 2)), ValueRect)
  456.                 End If
  457.             End If
  458.             If Rounded Then
  459.                 G.DrawPath(New Pen(Pal.ColDark), D.RoundRect(MainRect, roundness))
  460.             Else
  461.                 G.DrawRectangle(New Pen(Pal.ColDark), MainRect)
  462.             End If
  463.  
  464.             For i As Integer = TickStart To Width Step TickWidth
  465.                 G.DrawLine(New Pen(Color.FromArgb(100, Color.Gray)), New Point(i, Height - 5), New Point(i, Height - 1))
  466.             Next
  467.         End If
  468.  
  469.  
  470.     End Sub
  471.     Private Function ValueToPercentage(val As Integer) As Single
  472.         Dim min = Minimum
  473.         Dim max = Maximum
  474.         Return (val - min) / (max - min)
  475.     End Function
  476.  
  477.     Enum Type
  478.         Full
  479.         Ticked
  480.     End Enum
  481. End Class
  482. Public Class PECheckbox : Inherits ThemedControl
  483.     Public Property Checked As Boolean
  484.     Public Property Rounded As Boolean = True
  485.  
  486.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  487.         MyBase.OnMouseDown(e)
  488.         Checked = Not Checked
  489.     End Sub
  490.     Sub New()
  491.         MyBase.New()
  492.         Font = New Font("Segoe UI", 10.0F)
  493.         Height = 20
  494.     End Sub
  495.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  496.         Dim G As Graphics = e.Graphics
  497.         MyBase.OnPaint(e)
  498.         G.Clear(Me.BackColor)
  499.         Dim CheckedGrad As New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(200, 255, 2), Color.FromArgb(121, 172, 2))
  500.         Dim CheckedGradOutline As New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(9, 16, 1), Color.FromArgb(1, 3, 0))
  501.         If Rounded Then
  502.             G.SmoothingMode = SmoothingMode.HighQuality
  503.             Dim MainPath As GraphicsPath = D.RoundRect(New Rectangle(0, 0, Height - 2, Height - 2), 3)
  504.             Dim BorderPath As GraphicsPath = D.RoundRect(New Rectangle(0, 0, Height - 1, Height - 1), 3)
  505.             G.DrawPath(New Pen(Color.FromArgb(160, Pal.ColHigh)), BorderPath)
  506.             G.DrawPath(New Pen(Color.Black), MainPath)
  507.             If Checked Then
  508.                 G.FillPath(CheckedGrad, MainPath)
  509.                 G.DrawPath(New Pen(CheckedGradOutline), BorderPath)
  510.             Else
  511.                 G.FillPath(New SolidBrush(Color.FromArgb(100, Color.Black)), MainPath)
  512.             End If
  513.         Else
  514.             G.DrawRectangle(New Pen(Color.FromArgb(160, Pal.ColHigh)), New Rectangle(0, 0, Height - 1, Height - 1))
  515.             G.DrawRectangle(New Pen(Pal.ColDark), New Rectangle(0, 0, Height - 2, Height - 2))
  516.             If Checked Then
  517.                 Dim RectShadeBrush As New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(100, 9, 16, 1), Color.FromArgb(100, 1, 3, 0))
  518.                 G.FillRectangle(CheckedGrad, New Rectangle(0, 0, Height - 1, Height - 1))
  519.                 G.DrawRectangle(New Pen(CheckedGradOutline), New Rectangle(0, 0, Height - 1, Height - 1))
  520.                 G.DrawRectangle(New Pen(RectShadeBrush), New Rectangle(0, 0, Height - 2, Height - 2))
  521.             Else
  522.                 G.FillRectangle(New SolidBrush(Color.FromArgb(100, Color.Black)), New Rectangle(0, 0, Height - 2, Height - 2))
  523.             End If
  524.         End If
  525.         D.DrawTextWithShadow(G, New Rectangle(Height, 0, Width, Height - 1), Text, Font, HorizontalAlignment.Left, Color.FromArgb(155, 155, 160), Color.Black)
  526.     End Sub
  527. End Class
  528. Public Class PERadiobutton : Inherits ThemedControl
  529.     Public Property Checked As Boolean
  530.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  531.         MyBase.OnMouseDown(e)
  532.         For Each Cont As Control In Parent.Controls
  533.             If TypeOf Cont Is PERadiobutton Then
  534.                 DirectCast(Cont, PERadiobutton).Checked = False
  535.                 Cont.Invalidate()
  536.             End If
  537.         Next
  538.         Checked = True
  539.     End Sub
  540.     Sub New()
  541.         MyBase.New()
  542.         Font = New Font("Segoe UI", 10.0F)
  543.         Height = 20
  544.     End Sub
  545.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  546.         Dim G As Graphics = e.Graphics
  547.         MyBase.OnPaint(e)
  548.         G.Clear(Me.BackColor)
  549.  
  550.         Dim CheckedGrad As New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(200, 255, 2), Color.FromArgb(121, 172, 2))
  551.         Dim CheckedGradOutline As New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(9, 16, 1), Color.FromArgb(1, 3, 0))
  552.  
  553.         G.SmoothingMode = SmoothingMode.HighQuality
  554.         G.DrawEllipse(New Pen(Color.FromArgb(160, Pal.ColHigh)), New Rectangle(0, 0, Height - 1, Height - 1))
  555.         G.DrawEllipse(New Pen(Pal.ColDark), New Rectangle(0, 0, Height - 2, Height - 2))
  556.         If Checked Then
  557.             Dim RectShadeBrush As New LinearGradientBrush(New Point(0, 0), New Point(0, Height), Color.FromArgb(100, 9, 16, 1), Color.FromArgb(100, 1, 3, 0))
  558.             G.FillEllipse(CheckedGrad, New Rectangle(0, 0, Height - 1, Height - 1))
  559.             G.DrawEllipse(New Pen(CheckedGradOutline), New Rectangle(0, 0, Height - 1, Height - 1))
  560.             G.DrawEllipse(New Pen(RectShadeBrush), New Rectangle(0, 0, Height - 2, Height - 2))
  561.         Else
  562.             G.FillEllipse(New SolidBrush(Color.FromArgb(100, Color.Black)), New Rectangle(0, 0, Height - 2, Height - 2))
  563.         End If
  564.         D.DrawTextWithShadow(G, New Rectangle(Height, 0, Width, Height - 1), Text, Font, HorizontalAlignment.Left, Color.FromArgb(155, 155, 160), Color.Black)
  565.  
  566.     End Sub
  567. End Class
  568. Public Class PEGroupboxEmbossed : Inherits ThemedContainer
  569.     Public Property Rounded As Boolean = True
  570.     Sub New()
  571.         MyBase.New()
  572.         MinimumSize = New Size(10, 10)
  573.         TopGrip = 20
  574.         Font = New Font("Segoe UI", 10.0F)
  575.         BackColor = Pal.ColMed
  576.         ForeColor = Color.FromArgb(160, Color.White)
  577.     End Sub
  578.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  579.         Dim G As Graphics = e.Graphics
  580.         MyBase.OnPaint(e)
  581.         G.Clear(Me.BackColor)
  582.         G.SmoothingMode = SmoothingMode.HighQuality
  583.         If Rounded Then
  584.             Dim OuterPath As GraphicsPath = D.RoundRect(New Rectangle(1, 1, Width - 2, Height - 2), 5)
  585.             Dim OuterPathHighlight As GraphicsPath = D.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 5)
  586.             Dim OuterPathShadow As GraphicsPath = D.RoundRect(New Rectangle(1, 1, Width - 3, Height - 3), 5)
  587.             Dim InnerPath As GraphicsPath = D.RoundRect(New Rectangle(9, 9, Width - 19, Height - 19), 5)
  588.             Dim InnerPathHighlight As GraphicsPath = D.RoundRect(New Rectangle(9, 9, Width - 18, Height - 18), 5)
  589.             Dim InnerPathShadow As GraphicsPath = D.RoundRect(New Rectangle(10, 10, Width - 20, Height - 20), 5)
  590.             Dim Hat As New HatchBrush(HatchStyle.Percent30, Color.FromArgb(100, Pal.ColDim), Color.Transparent)
  591.             '|Fills
  592.            G.FillPath(New SolidBrush(Pal.ColMed), OuterPath)
  593.             G.FillPath(Hat, OuterPath)
  594.             G.FillPath(New SolidBrush(Pal.ColDim), InnerPath)
  595.             '| Borders
  596.            G.DrawPath(New Pen(Color.FromArgb(100, Pal.ColHigh)), OuterPathHighlight)
  597.             G.DrawPath(New Pen(Color.FromArgb(200, Pal.ColDark)), OuterPath)
  598.             G.DrawPath(New Pen(Color.FromArgb(100, Pal.ColHigh)), InnerPathHighlight)
  599.             G.DrawPath(New Pen(Color.FromArgb(100, Pal.ColDark)), InnerPathShadow)
  600.             G.DrawPath(New Pen(Color.FromArgb(200, Pal.ColDark)), InnerPath)
  601.         Else
  602.             Dim OuterRect As Rectangle = New Rectangle(1, 1, Width - 2, Height - 2)
  603.             Dim OuterRectHighlight As Rectangle = New Rectangle(0, 0, Width - 1, Height - 1)
  604.             Dim OuterRectShadow As Rectangle = New Rectangle(1, 1, Width - 3, Height - 3)
  605.             Dim InnerRect As Rectangle = New Rectangle(9, 9, Width - 19, Height - 19)
  606.             Dim InnerRectHighlight As Rectangle = New Rectangle(9, 9, Width - 18, Height - 18)
  607.             Dim InnerRectShadow As Rectangle = New Rectangle(10, 10, Width - 20, Height - 20)
  608.             Dim Hat As New HatchBrush(HatchStyle.Percent30, Color.FromArgb(100, Pal.ColDim), Color.Transparent)
  609.             '|Fills
  610.            G.FillRectangle(New SolidBrush(Pal.ColMed), OuterRect)
  611.             G.FillRectangle(Hat, OuterRect)
  612.             G.FillRectangle(New SolidBrush(Pal.ColDim), InnerRect)
  613.             '| Borders
  614.            G.DrawRectangle(New Pen(Color.FromArgb(100, Pal.ColHigh)), OuterRectHighlight)
  615.             G.DrawRectangle(New Pen(Color.FromArgb(200, Pal.ColDark)), OuterRect)
  616.             G.DrawRectangle(New Pen(Color.FromArgb(100, Pal.ColHigh)), InnerRectHighlight)
  617.             G.DrawRectangle(New Pen(Color.FromArgb(100, Pal.ColDark)), InnerRectShadow)
  618.             G.DrawRectangle(New Pen(Color.FromArgb(200, Pal.ColDark)), InnerRect)
  619.         End If
  620.  
  621.     End Sub
  622. End Class
  623. Public Class PEGroupboxEngraved : Inherits ThemedContainer
  624.     Public Property Rounded As Boolean = True
  625.     Sub New()
  626.         MyBase.New()
  627.         MinimumSize = New Size(10, 10)
  628.         TopGrip = 20
  629.         Font = New Font("Segoe UI", 10.0F)
  630.         BackColor = Pal.ColMed
  631.         ForeColor = Color.FromArgb(160, Color.White)
  632.     End Sub
  633.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  634.         Dim G As Graphics = e.Graphics
  635.         MyBase.OnPaint(e)
  636.         G.Clear(Me.BackColor)
  637.         G.SmoothingMode = SmoothingMode.HighQuality
  638.         If Rounded Then
  639.             Dim TexturePathHB As New TextureBrush(New Bitmap(D.CodeToImage(D.Texture)))
  640.             Dim OuterRect1 As GraphicsPath = D.RoundRect(New Rectangle(0, 0, Width - 2, Height - 2), 5)
  641.             Dim OuterRect2 As GraphicsPath = D.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 5)
  642.             '|=========| OUTER |START|
  643.            G.FillPath(New SolidBrush(Pal.ColDim), OuterRect1)
  644.             D.FillGradientBeam(G, Color.FromArgb(27, Color.Black), Color.FromArgb(8, Color.White), New Rectangle(0, 0, Width, Height), GradientAlignment.Vertical)
  645.             G.FillPath(TexturePathHB, OuterRect1)
  646.             G.DrawPath(New Pen(Color.FromArgb(160, Pal.ColHigh)), OuterRect2)
  647.             G.DrawPath(New Pen(Pal.ColDark), OuterRect1)
  648.             '| Shine
  649.            Dim ShineLGBTop As New LinearGradientBrush(New Point(5, 0), New Point(Width - 5, 0), Color.Transparent, Color.Transparent)
  650.             Dim ColBlend As New ColorBlend()
  651.             ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(75, Pal.ColHighest), Color.Transparent} : ShineLGBTop.InterpolationColors = ColBlend
  652.             G.DrawLine(New Pen(ShineLGBTop), New Point(5, Height - 1), New Point(Width - 5, Height - 1))
  653.             '|=========| Inner |END|
  654.            '|=========| Inner |START|
  655.            Dim InnerRect1 As GraphicsPath = D.RoundRect(New Rectangle(9, 9, Width - 19, Height - 19), 5)
  656.             Dim InnerRect2 As GraphicsPath = D.RoundRect(New Rectangle(10, 10, Width - 20, Height - 20), 5)
  657.             Dim InnerRect3 As GraphicsPath = D.RoundRect(New Rectangle(10, 10, Width - 21, Height - 21), 5)
  658.             G.FillPath(New SolidBrush(Pal.ColMed), InnerRect1)
  659.             G.DrawPath(New Pen(Pal.ColDim), InnerRect3)
  660.             G.DrawPath(New Pen(Color.FromArgb(160, Pal.ColHigh)), InnerRect2)
  661.             G.DrawPath(New Pen(Pal.ColDark), InnerRect1)
  662.             '| Shine
  663.            Dim ShineLGBMid As New LinearGradientBrush(New Point(14, 0), New Point(Width - 29, 0), Color.Transparent, Color.Transparent)
  664.             Dim ShineLGBMid2 As New LinearGradientBrush(New Point(14, 0), New Point(Width - 29, 0), Color.Transparent, Color.Transparent)
  665.             ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(150, Pal.ColHighest), Color.Transparent} : ShineLGBMid.InterpolationColors = ColBlend
  666.             ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(150, Pal.ColDark), Color.Transparent} : ShineLGBMid2.InterpolationColors = ColBlend
  667.             G.DrawLine(New Pen(ShineLGBMid), New Point(14, 10), New Point(Width - 29, 10))
  668.             G.DrawLine(New Pen(ShineLGBMid2), New Point(14, 11), New Point(Width - 29, 11))
  669.             '|=========| Inner |END|
  670.        Else
  671.             Dim TexturePathHB As New TextureBrush(New Bitmap(D.CodeToImage(D.Texture)))
  672.             Dim OuterRect1 As New Rectangle(0, 0, Width - 2, Height - 2)
  673.             Dim OuterRect2 As New Rectangle(0, 0, Width - 1, Height - 1)
  674.             '|=========| OUTER |START|
  675.            G.FillRectangle(New SolidBrush(Pal.ColDim), OuterRect1)
  676.             D.FillGradientBeam(G, Color.FromArgb(27, Color.Black), Color.FromArgb(8, Color.White), New Rectangle(0, 0, Width, Height), GradientAlignment.Vertical)
  677.             G.FillRectangle(TexturePathHB, OuterRect1)
  678.             G.DrawRectangle(New Pen(Color.FromArgb(160, Pal.ColHigh)), OuterRect2)
  679.             G.DrawRectangle(New Pen(Pal.ColDark), OuterRect1)
  680.             '| Shine
  681.            Dim ShineLGBTop As New LinearGradientBrush(New Point(0, 0), New Point(Width, 0), Color.Transparent, Color.Transparent)
  682.             Dim ColBlend As New ColorBlend()
  683.             ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(75, Pal.ColHighest), Color.Transparent} : ShineLGBTop.InterpolationColors = ColBlend
  684.             G.DrawLine(New Pen(ShineLGBTop), New Point(10, Height - 1), New Point(Width - 1, Height - 1))
  685.             '|=========| Inner |END|
  686.            '|=========| Inner |START|
  687.            Dim InnerRect1 As New Rectangle(9, 9, Width - 19, Height - 19)
  688.             Dim InnerRect2 As New Rectangle(10, 10, Width - 20, Height - 20)
  689.             Dim InnerRect3 As New Rectangle(10, 10, Width - 21, Height - 21)
  690.             G.FillRectangle(New SolidBrush(Pal.ColMed), InnerRect1)
  691.             G.DrawRectangle(New Pen(Pal.ColDim), InnerRect3)
  692.             G.DrawRectangle(New Pen(Color.FromArgb(160, Pal.ColHigh)), InnerRect2)
  693.             G.DrawRectangle(New Pen(Pal.ColDark), InnerRect1)
  694.             '| Shine
  695.            Dim ShineLGBMid As New LinearGradientBrush(New Point(9, 0), New Point(Width - 20, 0), Color.Transparent, Color.Transparent)
  696.             Dim ShineLGBMid2 As New LinearGradientBrush(New Point(9, 0), New Point(Width - 20, 0), Color.Transparent, Color.Transparent)
  697.             ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(150, Pal.ColHighest), Color.Transparent} : ShineLGBMid.InterpolationColors = ColBlend
  698.             ColBlend.Positions = {0, 1 / 2, 1} : ColBlend.Colors = {Color.Transparent, Color.FromArgb(150, Pal.ColDark), Color.Transparent} : ShineLGBMid2.InterpolationColors = ColBlend
  699.             G.DrawLine(New Pen(ShineLGBMid), New Point(10, 10), New Point(Width - 20, 10))
  700.             G.DrawLine(New Pen(ShineLGBMid2), New Point(10, 11), New Point(Width - 20, 11))
  701.             '|=========| Inner |END|
  702.        End If
  703.  
  704.     End Sub
  705.    
  706. End Class
  707. Public Class PEGroupboxEngraved_Simple : Inherits ThemedContainer
  708.     Public Property Rounded As Boolean = True
  709.     Public Property FillColor As Color = Pal.ColDim
  710.     Sub New()
  711.         MyBase.New()
  712.         MinimumSize = New Size(10, 10)
  713.         TopGrip = 20
  714.         Font = New Font("Segoe UI", 10.0F)
  715.         BackColor = Pal.ColMed
  716.         ForeColor = Color.FromArgb(160, Color.White)
  717.     End Sub
  718.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  719.         Dim G As Graphics = e.Graphics
  720.         MyBase.OnPaint(e)
  721.         G.Clear(Me.BackColor)
  722.         G.SmoothingMode = SmoothingMode.HighQuality
  723.          If Rounded Then
  724.             Dim OuterRect1 As GraphicsPath = D.RoundRect(New Rectangle(0, 0, Width - 2, Height - 2), 5)
  725.             Dim OuterRect2 As GraphicsPath = D.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 5)
  726.             '|=========| OUTER |START|
  727.            G.FillPath(New SolidBrush(FillColor), OuterRect1)
  728.             G.DrawPath(New Pen(Color.FromArgb(160, Pal.ColHigh)), OuterRect2)
  729.             G.DrawPath(New Pen(Pal.ColDark), OuterRect1)
  730.         Else
  731.             G.FillRectangle(New SolidBrush(FillColor), New Rectangle(0, 0, Width - 2, Height - 2))
  732.             G.DrawRectangle(New Pen(Color.FromArgb(160, Pal.ColHigh)), New Rectangle(0, 0, Width - 1, Height - 1))
  733.             G.DrawRectangle(New Pen(Pal.ColDark), New Rectangle(0, 0, Width - 2, Height - 2))
  734.         End If
  735.  
  736.     End Sub
  737. End Class
  738. Public Class PETextbox : Inherits ThemedTextbox
  739.     Public Property Rounded As Boolean = True
  740.     Property IsMultiline As Boolean
  741.         Get
  742.             Return Multiline
  743.         End Get
  744.         Set(ByVal value As Boolean)
  745.             Multiline = value
  746.             Invalidate()
  747.         End Set
  748.     End Property
  749.     Sub New()
  750.         MyBase.New()
  751.         SetStyle(ControlStyles.UserPaint, True)
  752.         SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
  753.         BorderStyle = Windows.Forms.BorderStyle.None
  754.         Multiline = IsMultiline
  755.         ForeColor = Pal.ColHighest
  756.         Font = New Font("Segoe UI", 10.0F)
  757.     End Sub
  758.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  759.         Dim G As Graphics = e.Graphics
  760.         MyBase.OnPaint(e)
  761.         If Not IsMultiline Then
  762.             ' Height = 25
  763.        End If
  764.  
  765.         G.Clear(BackColor)
  766.  
  767.         G.SmoothingMode = SmoothingMode.HighQuality
  768.         If Rounded Then
  769.             Dim OuterRect1 As GraphicsPath = D.RoundRect(New Rectangle(0, 0, Width - 2, Height - 2), 5)
  770.             Dim OuterRect2 As GraphicsPath = D.RoundRect(New Rectangle(0, 0, Width - 1, Height - 1), 5)
  771.             '|=========| OUTER |START|
  772.            G.FillPath(New SolidBrush(Color.FromArgb(21, 21, 21)), OuterRect1)
  773.             G.DrawPath(New Pen(Color.FromArgb(160, Pal.ColHigh)), OuterRect2)
  774.             G.DrawPath(New Pen(Pal.ColDark), OuterRect1)
  775.         Else
  776.             G.FillRectangle(New SolidBrush(Color.FromArgb(21, 21, 21)), New Rectangle(0, 0, Width - 2, Height - 2))
  777.             G.DrawRectangle(New Pen(Color.FromArgb(160, Pal.ColHigh)), New Rectangle(0, 0, Width - 1, Height - 1))
  778.             G.DrawRectangle(New Pen(Pal.ColDark), New Rectangle(0, 0, Width - 2, Height - 2))
  779.         End If
  780.         If Multiline Then
  781.             Dim ccount As Integer = CountCharacter(Text, CChar(vbNewLine))
  782.             D.DrawTextWithShadow(G, New Rectangle(3, 0, Width, Height - 1), Text, Font, Me.TextAlign, Color.FromArgb(155, 155, 160), Color.Black)
  783.         Else
  784.             D.DrawTextWithShadow(G, New Rectangle(3, 0, Width, Height - 1), Text, Font, Me.TextAlign, Color.FromArgb(155, 155, 160), Color.Black)
  785.         End If
  786.     End Sub
  787.     Public Function CountCharacter(ByVal value As String, ByVal ch As Char) As Integer
  788.         Dim cnt As Integer = 0
  789.         For Each c As Char In value
  790.             If c = ch Then cnt += 1
  791.         Next
  792.         Return cnt
  793.     End Function
  794. End Class
  795. #End Region
  796.  
  797. #Region "Theme Utility Stuff"
  798. Public Class Palette
  799.     Public ColHighest As Color
  800.     Public ColHigh As Color
  801.     Public ColMed As Color
  802.     Public ColDim As Color
  803.     Public ColDark As Color
  804. End Class
  805. Public Enum ImageMode As Byte
  806.     Normal = 0
  807.     Scaled = 1
  808. End Enum
  809. Public Enum MouseState As Byte
  810.     None = 0
  811.     Over = 1
  812.     Down = 2
  813.     Block = 3
  814. End Enum
  815. Public Enum GradientAlignment As Byte
  816.     Vertical = 0
  817.     Horizontal = 1
  818. End Enum
  819. Public Class DrawUtils
  820.     Public Texture As String = "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"
  821.     Public Texture2 As String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAPCAYAAADtc08vAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAADySURBVHjapNPJSkNBEAXQUxk04kIDZuEAov6af+Vv+QcOiANk4YBPfeWmHoQXo0IKiobue2/fqq6OzLRODKwZo1/OjnCMT9zi6r8CU5zjpLd/jQs8/CVwivvKfpz1BaJrYkSAzNzAASYLuESDm4hoCrcskJlRhGF3QZHhq3D5o0CBB1XWuNYB2iI31dA2IrLjjXpPOsYWtiuHRX7DC17RZGbbOVsUiCJPMcMuNvGBOR4L15abJQdt3TrDIfaqkU3tB94rVwo8Y6fIswWBqBKeylGuGuU5LqvuSS8Td+VgeQ56MaxJ3C+xmxrltg+MdX/j9wCsYFw8P56nMgAAAABJRU5ErkJggg=="
  822.     Public Sub FillGradientBeam(ByVal g As Graphics, ByVal Col1 As Color, ByVal Col2 As Color, ByVal rect As Rectangle, ByVal align As GradientAlignment)
  823.         Dim stored As SmoothingMode = g.SmoothingMode
  824.         Dim Blend As New ColorBlend
  825.         g.SmoothingMode = SmoothingMode.HighQuality
  826.         Select Case align
  827.             Case GradientAlignment.Vertical
  828.                 Dim PathGradient As New LinearGradientBrush(New Point(rect.X, rect.Y), New Point(rect.X + rect.Width - 1, rect.Y), Color.Black, Color.Black)
  829.                 Blend.Positions = {0, 1 / 2, 1}
  830.                 Blend.Colors = {Col1, Col2, Col1}
  831.                 PathGradient.InterpolationColors = Blend
  832.                 g.FillRectangle(PathGradient, rect)
  833.             Case GradientAlignment.Horizontal
  834.                 Dim PathGradient As New LinearGradientBrush(New Point(rect.X, rect.Y), New Point(rect.X, rect.Y + rect.Height), Color.Black, Color.Black)
  835.                 Blend.Positions = {0, 1 / 2, 1}
  836.                 Blend.Colors = {Col1, Col2, Col1}
  837.                 PathGradient.InterpolationColors = Blend
  838.                 PathGradient.RotateTransform(0)
  839.                 g.FillRectangle(PathGradient, rect)
  840.         End Select
  841.         g.SmoothingMode = stored
  842.     End Sub  
  843.     Public Sub FillDualGradPath(ByVal g As Graphics, ByVal Col1 As Color, ByVal Col2 As Color, ByVal rect As Rectangle, ByVal gp As GraphicsPath, ByVal align As GradientAlignment)
  844.         Dim stored As SmoothingMode = g.SmoothingMode
  845.         Dim Blend As New ColorBlend
  846.         g.SmoothingMode = SmoothingMode.HighQuality
  847.         Select Case align
  848.             Case GradientAlignment.Vertical
  849.                 Dim PathGradient As New LinearGradientBrush(New Point(rect.X, rect.Y), New Point(rect.X + rect.Width - 1, rect.Y), Color.Black, Color.Black)
  850.                 Blend.Positions = {0, 1 / 2, 1}
  851.                 Blend.Colors = {Col1, Col2, Col1}
  852.                 PathGradient.InterpolationColors = Blend
  853.                 g.FillPath(PathGradient, gp)
  854.             Case GradientAlignment.Horizontal
  855.                 Dim PathGradient As New LinearGradientBrush(New Point(rect.X, rect.Y), New Point(rect.X, rect.Y + rect.Height), Color.Black, Color.Black)
  856.                 Blend.Positions = {0, 1 / 2, 1}
  857.                 Blend.Colors = {Col1, Col2, Col1}
  858.                 PathGradient.InterpolationColors = Blend
  859.                 PathGradient.RotateTransform(0)
  860.                 g.FillPath(PathGradient, gp)
  861.         End Select
  862.         g.SmoothingMode = stored
  863.     End Sub
  864.     Public Sub DrawTextWithShadow(ByVal G As Graphics, ByVal ContRect As Rectangle, ByVal Text As String, ByVal TFont As Font, ByVal TAlign As HorizontalAlignment, ByVal TColor As Color, ByVal BColor As Color)
  865.         DrawText(G, New Rectangle(ContRect.X + 1, ContRect.Y + 1, ContRect.Width, ContRect.Height), Text, TFont, TAlign, BColor)
  866.         DrawText(G, ContRect, Text, TFont, TAlign, TColor)
  867.     End Sub
  868.     Public Sub DrawText(ByVal G As Graphics, ByVal ContRect As Rectangle, ByVal Text As String, ByVal TFont As Font, ByVal TAlign As HorizontalAlignment, ByVal TColor As Color)
  869.         If String.IsNullOrEmpty(Text) Then Return
  870.         Dim TextSize As Size = G.MeasureString(Text, TFont).ToSize
  871.         Dim CenteredY As Integer = ContRect.Height \ 2 - TextSize.Height \ 2
  872.         Select Case TAlign
  873.             Case HorizontalAlignment.Left
  874.                 Dim sf As New StringFormat
  875.                 sf.LineAlignment = StringAlignment.Near
  876.                 sf.Alignment = StringAlignment.Near
  877.                 G.DrawString(Text, TFont, New SolidBrush(TColor), New Rectangle(ContRect.X, ContRect.Y, ContRect.Width, ContRect.Height), sf)
  878.             Case HorizontalAlignment.Right
  879.                 Dim sf As New StringFormat
  880.                 sf.LineAlignment = StringAlignment.Far
  881.                 sf.Alignment = StringAlignment.Far
  882.                 G.DrawString(Text, TFont, New SolidBrush(TColor), New Rectangle(ContRect.X, ContRect.Y, ContRect.Width, ContRect.Height / 2 + TextSize.Height / 2), sf)
  883.             Case HorizontalAlignment.Center
  884.                 Dim sf As New StringFormat
  885.                 sf.LineAlignment = StringAlignment.Center
  886.                 sf.Alignment = StringAlignment.Center
  887.                 G.DrawString(Text, TFont, New SolidBrush(TColor), ContRect, sf)
  888.         End Select
  889.     End Sub
  890.     Public Function RoundRect(ByVal Rectangle As Rectangle, ByVal Curve As Integer) As GraphicsPath
  891.         Dim Path As New GraphicsPath
  892.         Dim ArcRectangleWidth As Integer = Curve * 2
  893.         With Path
  894.             .AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  895.             .AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  896.             .AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 0, 90)
  897.             .AddArc(New Rectangle(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), 90, 90)
  898.             .AddLine(New Point(Rectangle.X, Rectangle.Height - ArcRectangleWidth + Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
  899.         End With
  900.         Return Path
  901.     End Function
  902.     Public Function RoundedTopRect(ByVal Rectangle As Rectangle, ByVal Curve As Integer) As GraphicsPath
  903.         Dim Path As GraphicsPath = New GraphicsPath()
  904.         Dim ArcRectangleWidth As Integer = Curve * 2
  905.         With Path
  906.             .AddArc(New Rectangle(Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -180, 90)
  907.             .AddArc(New Rectangle(Rectangle.Width - ArcRectangleWidth + Rectangle.X, Rectangle.Y, ArcRectangleWidth, ArcRectangleWidth), -90, 90)
  908.             .AddLine(New Point(Rectangle.X + Rectangle.Width, Rectangle.Y + ArcRectangleWidth), New Point(Rectangle.X + Rectangle.Width, Rectangle.Y + Rectangle.Height))
  909.             .AddLine(New Point(Rectangle.X, Rectangle.Height + Rectangle.Y), New Point(Rectangle.X, Rectangle.Y + Curve))
  910.         End With
  911.         Return Path
  912.     End Function
  913.     Public Function CodeToImage(ByVal Code As String) As Image
  914.         Return Image.FromStream(New System.IO.MemoryStream(Convert.FromBase64String(Code)))
  915.     End Function
  916. End Class
  917. #End Region
Add Comment
Please, Sign In to add comment