THE_LORD

Youtube Theme

Jun 19th, 2017
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 77.63 KB | None | 0 0
  1. '' <summary>
  2. '' Youtube Theme
  3. '' Author : THE LORD
  4. '' Release Date : Monday, June 19, 2017
  5. '' Updated : Wednesday, June 21, 2017
  6. '' HF Account : https://hackforums.net/member.php?action=profile&uid=3304362
  7. '' PM Me for any bug.
  8. '' </summary>
  9.  
  10. #Region " Namespaces "
  11.  
  12. Imports System.Drawing.Drawing2D
  13. Imports System.ComponentModel
  14. Imports System.Drawing.Text
  15.  
  16. #End Region
  17.  
  18. #Region " Helper "
  19.  
  20. Public Module Helpers
  21.  
  22. #Region " MouseStates "
  23.  
  24.     ''' <summary>
  25.     ''' The helper enumerator to get mouse states.
  26.     ''' </summary>
  27.     Public Enum MouseMode As Byte
  28.         Normal
  29.         Hovered
  30.         Pushed
  31.         Disabled
  32.     End Enum
  33.  
  34. #End Region
  35.  
  36. #Region " Draw Methods "
  37.  
  38.     ''' <summary>
  39.     ''' The Method to draw the image from encoded base64 string.
  40.     ''' </summary>
  41.     ''' <param name="G">The Graphics to draw the image.</param>
  42.     ''' <param name="Base64Image">The Encoded base64 image.</param>
  43.     ''' <param name="Rect">The Rectangle area for the image.</param>
  44.     Public Sub DrawImageFromBase64(ByVal G As Graphics, ByVal Base64Image As String, ByVal Rect As Rectangle)
  45.         Dim IM As Image = Nothing
  46.         With G
  47.             Using ms As New System.IO.MemoryStream(Convert.FromBase64String(Base64Image))
  48.                 IM = Image.FromStream(ms) : ms.Close()
  49.             End Using
  50.             .DrawImage(IM, Rect)
  51.         End With
  52.     End Sub
  53.  
  54.     ''' <summary>
  55.     ''' The Method to fill rounded rectangle.
  56.     ''' </summary>
  57.     ''' <param name="G">The Graphics to draw the image.</param>
  58.     ''' <param name="C">The Color to the rectangle area.</param>
  59.     ''' <param name="Rect">The Rectangle area to be filled.</param>
  60.     ''' <param name="Curve">The Rounding border radius.</param>
  61.     ''' <param name="TopLeft">Wether the top left of rectangle be round or not.</param>
  62.     ''' <param name="TopRight">Wether the top right of rectangle be round or not.</param>
  63.     ''' <param name="BottomLeft">Wether the bottom left of rectangle be round or not.</param>
  64.     ''' <param name="BottomRight">Wether the bottom right of rectangle be round or not.</param>
  65.     Public Sub FillRoundedPath(ByVal G As Graphics, ByVal C As Color, ByVal Rect As Rectangle, ByVal Curve As Integer, _
  66.                                  Optional ByVal TopLeft As Boolean = True, Optional ByVal TopRight As Boolean = True, _
  67.                                  Optional ByVal BottomLeft As Boolean = True, Optional ByVal BottomRight As Boolean = True)
  68.         With G
  69.             .FillPath(New SolidBrush(C), RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight))
  70.         End With
  71.     End Sub
  72.  
  73.     ''' <summary>
  74.     ''' The Method to fill the rounded rectangle.
  75.     ''' </summary>
  76.     ''' <param name="G">The Graphics to fill the rectangle.</param>
  77.     ''' <param name="B">The brush to the rectangle area.</param>
  78.     ''' <param name="Rect">The Rectangle area to be filled.</param>
  79.     ''' <param name="Curve">The Rounding border radius.</param>
  80.     ''' <param name="TopLeft">Wether the top left of rectangle be round or not.</param>
  81.     ''' <param name="TopRight">Wether the top right of rectangle be round or not.</param>
  82.     ''' <param name="BottomLeft">Wether the bottom left of rectangle be round or not.</param>
  83.     ''' <param name="BottomRight">Wether the bottom right of rectangle be round or not.</param>
  84.     Public Sub FillRoundedPath(ByVal G As Graphics, ByVal B As Brush, ByVal Rect As Rectangle, ByVal Curve As Integer, _
  85.                                  Optional ByVal TopLeft As Boolean = True, Optional ByVal TopRight As Boolean = True, _
  86.                                  Optional ByVal BottomLeft As Boolean = True, Optional ByVal BottomRight As Boolean = True)
  87.         With G
  88.             .FillPath(B, RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight))
  89.         End With
  90.     End Sub
  91.    
  92.     ''' <summary>
  93.     ''' The Method to fill the rectangle the base color and surrounding with another color(Rectangle with shadow).
  94.     ''' </summary>
  95.     ''' <param name="G">The Graphics to fill the rectangle.</param>
  96.     ''' <param name="CenterColor">The Center color of the rectangle area.</param>
  97.     ''' <param name="SurroundColor">The Inner Surround color of the rectangle area.</param>
  98.     ''' <param name="P">The Point of the surrounding color.</param>
  99.     ''' <param name="Rect">The Rectangle area to be filled.</param>
  100.     ''' <param name="Curve">The Rounding border radius.</param>
  101.     ''' <param name="TopLeft">Wether the top left of rectangle be round or not.</param>
  102.     ''' <param name="TopRight">Wether the top right of rectangle be round or not.</param>
  103.     ''' <param name="BottomLeft">Wether the bottom left of rectangle be round or not.</param>
  104.     ''' <param name="BottomRight">Wether the bottom right of rectangle be round or not.</param>
  105.     Public Sub FillWithInnerRectangle(ByVal G As Graphics, ByVal CenterColor As Color, ByVal SurroundColor As Color, ByVal P As Point, ByVal Rect As Rectangle, ByVal Curve As Integer, _
  106.                          Optional ByVal TopLeft As Boolean = True, Optional ByVal TopRight As Boolean = True, _
  107.                          Optional ByVal BottomLeft As Boolean = True, Optional ByVal BottomRight As Boolean = True)
  108.         Using PGB As New PathGradientBrush(RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight))
  109.             With PGB
  110.                 .CenterColor = CenterColor
  111.                 .SurroundColors = New Color() {SurroundColor}
  112.                 .FocusScales = P
  113.                 With G
  114.                     Dim GP As New GraphicsPath With {.FillMode = FillMode.Winding}
  115.                     GP.AddRectangle(Rect)
  116.                     .FillPath(PGB, GP)
  117.                     GP.Dispose()
  118.                 End With
  119.             End With
  120.         End Using
  121.     End Sub
  122.  
  123.     ''' <summary>
  124.     ''' The Method to fill the circle the base color and surrounding with another color(Rectangle with shadow).
  125.     ''' </summary>
  126.     ''' <param name="G">The Graphics to fill the circle.</param>
  127.     ''' <param name="CenterColor">The Center color of the rectangle area.</param>
  128.     ''' <param name="SurroundColor">The Inner Surround color of the rectangle area.</param>
  129.     ''' <param name="P">The Point of the surrounding color.</param>
  130.     ''' <param name="Rect">The circle area to be filled.</param>
  131.     Public Sub FillWithInnerEllipse(ByVal G As Graphics, ByVal CenterColor As Color, ByVal SurroundColor As Color, ByVal P As Point, ByVal Rect As Rectangle)
  132.         Dim GP As New GraphicsPath With {.FillMode = FillMode.Winding}
  133.         GP.AddEllipse(Rect)
  134.         Using PGB As New PathGradientBrush(GP)
  135.             With PGB
  136.                 .CenterColor = CenterColor
  137.                 .SurroundColors = New Color() {SurroundColor}
  138.                 .FocusScales = P
  139.                 With G
  140.                     .FillPath(PGB, GP)
  141.                     GP.Dispose()
  142.                 End With
  143.             End With
  144.         End Using
  145.     End Sub
  146.  
  147.     ''' <summary>
  148.     ''' The Method to fill the rounded rectangle the base color and surrounding with another color(Rectangle with shadow).
  149.     ''' </summary>
  150.     ''' <param name="G">The Graphics to fill rounded the rectangle.</param>
  151.     ''' <param name="CenterColor">The Center color of the rectangle area.</param>
  152.     ''' <param name="SurroundColor">The Inner Surround color of the rectangle area.</param>
  153.     ''' <param name="P">The Point of the surrounding color.</param>
  154.     ''' <param name="Rect">The Rectangle area to be filled.</param>
  155.     ''' <param name="Curve">The Rounding border radius.</param>
  156.     ''' <param name="TopLeft">Wether the top left of rectangle be round or not.</param>
  157.     ''' <param name="TopRight">Wether the top right of rectangle be round or not.</param>
  158.     ''' <param name="BottomLeft">Wether the bottom left of rectangle be round or not.</param>
  159.     ''' <param name="BottomRight">Wether the bottom right of rectangle be round or not.</param>
  160.     Public Sub FillWithInnerRoundedPath(ByVal G As Graphics, ByVal CenterColor As Color, ByVal SurroundColor As Color, ByVal P As Point, ByVal Rect As Rectangle, ByVal Curve As Integer, _
  161.                      Optional ByVal TopLeft As Boolean = True, Optional ByVal TopRight As Boolean = True, _
  162.                      Optional ByVal BottomLeft As Boolean = True, Optional ByVal BottomRight As Boolean = True)
  163.         Using PGB As New PathGradientBrush(RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight))
  164.             With PGB
  165.                 .CenterColor = CenterColor
  166.                 .SurroundColors = New Color() {SurroundColor}
  167.                 .FocusScales = P
  168.                 With G
  169.                     .FillPath(PGB, RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight))
  170.                 End With
  171.             End With
  172.         End Using
  173.     End Sub
  174.  
  175.     ''' <summary>
  176.     ''' The Method to draw the rounded rectangle area.
  177.     ''' </summary>
  178.     ''' <param name="G">The Graphics to draw rounded the rectangle.</param>
  179.     ''' <param name="C">Border Color</param>
  180.     ''' <param name="Size">Border thickness</param>
  181.     ''' <param name="Rect">The Rectangle area to be drawn.</param>
  182.     ''' <param name="Curve">The Rounding border radius.</param>
  183.     ''' <param name="TopLeft">Wether the top left of rectangle be round or not.</param>
  184.     ''' <param name="TopRight">Wether the top right of rectangle be round or not.</param>
  185.     ''' <param name="BottomLeft">Wether the bottom left of rectangle be round or not.</param>
  186.     ''' <param name="BottomRight">Wether the bottom right of rectangle be round or not.</param>
  187.     Public Sub DrawRoundedPath(ByVal G As Graphics, ByVal C As Color, ByVal Size As Single, ByVal Rect As Rectangle, ByVal Curve As Integer, _
  188.                                  Optional ByVal TopLeft As Boolean = True, Optional ByVal TopRight As Boolean = True, _
  189.                                  Optional ByVal BottomLeft As Boolean = True, Optional ByVal BottomRight As Boolean = True)
  190.         With G
  191.             .DrawPath(New Pen(C, Size), RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight))
  192.         End With
  193.     End Sub
  194.  
  195.     ''' <summary>
  196.     ''' The method to draw the triangle.
  197.     ''' </summary>
  198.     ''' <param name="G">The Graphics to draw triangle.</param>
  199.     ''' <param name="C">The Triangle Color.</param>
  200.     ''' <param name="Size">The Triangle thickness</param>
  201.     ''' <param name="P1">Point 1</param>
  202.     ''' <param name="P2">Point 2</param>
  203.     ''' <param name="P3">Point 3</param>
  204.     ''' <param name="P4">Point 4</param>
  205.     ''' <param name="P5">Point 5</param>
  206.     ''' <param name="P6">Point 6</param>
  207.     Public Sub DrawTriangle(ByVal G As Graphics, ByVal C As Color, ByVal Size As Integer, ByVal P1 As Point, ByVal P2 As Point, ByVal P3 As Point, ByVal P4 As Point, ByVal P5 As Point, ByVal P6 As Point)
  208.         With G
  209.             .DrawLine(New Pen(C, Size), P1, P2)
  210.             .DrawLine(New Pen(C, Size), P3, P4)
  211.             .DrawLine(New Pen(C, Size), P5, P6)
  212.         End With
  213.     End Sub
  214.  
  215.     ''' <summary>
  216.     ''' The Method to fill the rectangle with border.
  217.     ''' </summary>
  218.     ''' <param name="G">The Graphics to fill the the rectangle.</param>
  219.     ''' <param name="Rect">The Rectangle to fill.</param>
  220.     ''' <param name="RectColor">The Rectangle color.</param>
  221.     ''' <param name="StrokeColor">The Stroke(Border) color.</param>
  222.     ''' <param name="StrokeSize">The Stroke thickness.</param>
  223.     Public Sub FillStrokedRectangle(ByVal G As Graphics, ByVal Rect As Rectangle, ByVal RectColor As Color, ByVal StrokeColor As Color, Optional ByVal StrokeSize As Integer = 1)
  224.         Using B As New SolidBrush(RectColor), S As New Pen(StrokeColor, StrokeSize)
  225.             G.FillRectangle(B, Rect)
  226.             G.DrawRectangle(S, Rect)
  227.         End Using
  228.     End Sub
  229.  
  230.     ''' <summary>
  231.     ''' The Method to fill rounded rectangle with border.
  232.     ''' </summary>
  233.     ''' <param name="G">The Graphics to fill rounded the rectangle.</param>
  234.     ''' <param name="Rect">The Rectangle to fill.</param>
  235.     ''' <param name="RectColor">The Rectangle color.</param>
  236.     ''' <param name="StrokeColor">The Stroke(Border) color.</param>
  237.     ''' <param name="StrokeSize">The Stroke thickness.</param>
  238.     ''' <param name="Curve">The Rounding border radius.</param>
  239.     ''' <param name="TopLeft">Wether the top left of rectangle be round or not.</param>
  240.     ''' <param name="TopRight">Wether the top right of rectangle be round or not.</param>
  241.     ''' <param name="BottomLeft">Wether the bottom left of rectangle be round or not.</param>
  242.     ''' <param name="BottomRight">Wether the bottom right of rectangle be round or not.</param>
  243.     Public Sub FillRoundedStrokedRectangle(ByVal G As Graphics, ByVal Rect As Rectangle, ByVal RectColor As Color, ByVal StrokeColor As Color, Optional ByVal StrokeSize As Integer = 1, Optional ByVal curve As Integer = 1, _
  244.                                  Optional ByVal TopLeft As Boolean = True, Optional ByVal TopRight As Boolean = True, _
  245.                                  Optional ByVal BottomLeft As Boolean = True, Optional ByVal BottomRight As Boolean = True)
  246.         Using B As New SolidBrush(RectColor)
  247.             FillRoundedPath(G, B, Rect, curve, TopLeft, TopRight, BottomLeft, BottomRight)
  248.             DrawRoundedPath(G, StrokeColor, StrokeSize, Rect, curve, TopLeft, TopRight, BottomLeft, BottomRight)
  249.         End Using
  250.     End Sub
  251.    
  252.     ''' <summary>
  253.     ''' The Method to draw the image with custom color.
  254.     ''' </summary>
  255.     ''' <param name="G"> The Graphic to draw the image.</param>
  256.     ''' <param name="R"> The Rectangle area of image.</param>
  257.     ''' <param name="_Image"> The image that the custom color applies on it.</param>
  258.     ''' <param name="C">The Color that be applied to the image.</param>
  259.     ''' <remarks></remarks>
  260.  
  261.     Public Sub DrawImageWithColor(ByVal G As Graphics, ByVal R As Rectangle, ByVal _Image As Image, C As Color)
  262.         Dim ptsArray As Single()() = {
  263.             New Single() {Convert.ToSingle(C.R / 255), 0, 0, 0, 0}, _
  264.             New Single() {0, Convert.ToSingle(C.G / 255), 0, 0, 0}, _
  265.             New Single() {0, 0, Convert.ToSingle(C.B / 255), 0, 0}, _
  266.             New Single() {0, 0, 0, Convert.ToSingle(C.A / 255), 0}, _
  267.             New Single() {Convert.ToSingle(C.R / 255), Convert.ToSingle(C.G / 255), Convert.ToSingle(C.B / 255), 0.0F, Convert.ToSingle(C.A / 255)}}
  268.         Dim imgAttribs As New Imaging.ImageAttributes
  269.         imgAttribs.SetColorMatrix(New Imaging.ColorMatrix(ptsArray), Imaging.ColorMatrixFlag.Default, Imaging.ColorAdjustType.Default)
  270.         G.DrawImage(_Image, R, 0, 0, _Image.Width, _Image.Height, GraphicsUnit.Pixel, imgAttribs)
  271.     End Sub
  272.  
  273.     ''' <summary>
  274.     ''' The Method to draw the image with custom color.
  275.     ''' </summary>
  276.     ''' <param name="G"> The Graphic to draw the image.</param>
  277.     ''' <param name="R"> The Rectangle area of image.</param>
  278.     ''' <param name="_Image"> The Encoded base64 image that the custom color applies on it.</param>
  279.     ''' <param name="C">The Color that be applied to the image.</param>
  280.     ''' <remarks></remarks>
  281.     Public Sub DrawImageWithColor(ByVal G As Graphics, ByVal R As Rectangle, ByVal _Image As String, C As Color)
  282.         Dim IM As Image = ImageFromBase64(_Image)
  283.         Dim ptsArray As Single()() = {
  284.             New Single() {Convert.ToSingle(C.R / 255), 0, 0, 0, 0}, _
  285.             New Single() {0, Convert.ToSingle(C.G / 255), 0, 0, 0}, _
  286.             New Single() {0, 0, Convert.ToSingle(C.B / 255), 0, 0}, _
  287.             New Single() {0, 0, 0, Convert.ToSingle(C.A / 255), 0}, _
  288.             New Single() {Convert.ToSingle(C.R / 255), Convert.ToSingle(C.G / 255), Convert.ToSingle(C.B / 255), 0.0F, Convert.ToSingle(C.A / 255)}}
  289.         Dim imgAttribs As New Imaging.ImageAttributes
  290.         imgAttribs.SetColorMatrix(New Imaging.ColorMatrix(ptsArray), Imaging.ColorMatrixFlag.Default, Imaging.ColorAdjustType.Default)
  291.         G.DrawImage(IM, R, 0, 0, IM.Width, IM.Height, GraphicsUnit.Pixel, imgAttribs)
  292.     End Sub
  293.  
  294. #End Region
  295.  
  296. #Region " Shapes "
  297.  
  298.     ''' <summary>
  299.     ''' The Triangle that joins 3 points to the triangle shape.
  300.     ''' </summary>
  301.     ''' <param name="P1">Point 1.</param>
  302.     ''' <param name="P2">Point 2.</param>
  303.     ''' <param name="P3">Point 3.</param>
  304.     ''' <returns>The Trangle shape based on given points.</returns>
  305.     Public Function Triangle(ByVal P1 As Point, ByVal P2 As Point, ByVal P3 As Point) As Point()
  306.         Return New Point() {P1, P2, P3}
  307.     End Function
  308.  
  309. #End Region
  310.  
  311. #Region " Brushes "
  312.  
  313.     ''' <summary>
  314.     ''' The Brush with two colors one center another surounding the center based on the given rectangle area.
  315.     ''' </summary>
  316.     ''' <param name="CenterColor">The Center color of the rectangle.</param>
  317.     ''' <param name="SurroundColor">The Surrounding color of the rectangle.</param>
  318.     ''' <param name="P">The Point of surrounding.</param>
  319.     ''' <param name="Rect">The Rectangle of the brush.</param>
  320.     ''' <returns>The Brush with two colors one center another surounding the center.</returns>
  321.     Public Function GlowBrush(ByVal CenterColor As Color, ByVal SurroundColor As Color, ByVal P As Point, ByVal Rect As Rectangle) As PathGradientBrush
  322.         Dim GP As New GraphicsPath With {.FillMode = FillMode.Winding}
  323.         GP.AddRectangle(Rect)
  324.         Return New PathGradientBrush(GP) With {.CenterColor = CenterColor, .SurroundColors = New Color() {SurroundColor}, .FocusScales = P}
  325.         GP.Dispose()
  326.     End Function
  327.  
  328.     ''' <summary>
  329.     ''' The Brush from RGBA color.
  330.     ''' </summary>
  331.     ''' <param name="R">Red.</param>
  332.     ''' <param name="G">Green.</param>
  333.     ''' <param name="B">Blue.</param>
  334.     ''' <param name="A">Alpha.</param>
  335.     ''' <returns>The Brush from given RGBA color.</returns>
  336.     Public Function SolidBrushRGBColor(ByVal R As Integer, ByVal G As Integer, ByVal B As Integer, Optional ByVal A As Integer = 0) As SolidBrush
  337.         Return New SolidBrush(Color.FromArgb(A, R, G, B))
  338.     End Function
  339.  
  340.     ''' <summary>
  341.     ''' The Brush from HEX color.
  342.     ''' </summary>
  343.     ''' <param name="C_WithoutHash">HEX Color without hash.</param>
  344.     ''' <returns>The Brush from given HEX color.</returns>
  345.     Public Function SolidBrushHTMlColor(ByVal C_WithoutHash As String) As SolidBrush
  346.         Return New SolidBrush(GetHTMLColor(C_WithoutHash))
  347.     End Function
  348.  
  349. #End Region
  350.  
  351. #Region " Pens "
  352.  
  353.     ''' <summary>
  354.     ''' The Pen from RGBA color.
  355.     ''' </summary>
  356.     ''' <param name="R">Red.</param>
  357.     ''' <param name="G">Green.</param>
  358.     ''' <param name="B">Blue.</param>
  359.     ''' <param name="A">Alpha.</param>
  360.     ''' <returns>The Pen from given RGBA color.</returns>
  361.     Public Function PenRGBColor(ByVal R As Integer, ByVal G As Integer, ByVal B As Integer, ByVal A As Integer, ByVal Size As Single) As Pen
  362.         Return New Pen(Color.FromArgb(A, R, G, B), Size)
  363.     End Function
  364.  
  365.     ''' <summary>
  366.     ''' The Pen from HEX color.
  367.     ''' </summary>
  368.     ''' <param name="C_WithoutHash">HEX Color without hash.</param>
  369.     ''' <param name="Size">The Size of the pen.</param>
  370.     ''' <returns></returns>
  371.     Public Function PenHTMlColor(ByVal C_WithoutHash As String, Optional ByVal Size As Single = 1) As Pen
  372.         Return New Pen(GetHTMLColor(C_WithoutHash), Size)
  373.     End Function
  374.  
  375. #End Region
  376.  
  377. #Region " Colors "
  378.  
  379.     ''' <summary>
  380.     '''
  381.     ''' </summary>
  382.     ''' <param name="C_WithoutHash"></param>
  383.     ''' <returns></returns>
  384.     Public Function GetHTMLColor(ByVal C_WithoutHash As String) As Color
  385.         Return ColorTranslator.FromHtml("#" & C_WithoutHash)
  386.     End Function
  387.    
  388.     ''' <summary>
  389.     ''' The Color from HEX by alpha property.
  390.     ''' </summary>
  391.     ''' <param name="alpha">Alpha.</param>
  392.     ''' <param name="C_WithoutHash">HEX Color without hash.</param>
  393.     ''' <returns>The Color from HEX with given ammount of transparency</returns>
  394.     Public Function GetAlphaHTMLColor(ByVal alpha As integer ,ByVal C_WithoutHash As String) As Color
  395.         Return Color.FromArgb(alpha,ColorTranslator.FromHtml("#" & C_WithoutHash))
  396.     End Function
  397.  
  398. #End Region
  399.  
  400. #Region " Methods "
  401.  
  402.     ''' <summary>
  403.     ''' The String format to provide the alignment.
  404.     ''' </summary>
  405.     ''' <param name="Horizontal">Horizontal alignment.</param>
  406.     ''' <param name="Vertical">Horizontal alignment. alignment.</param>
  407.     ''' <returns>The String format.</returns>
  408.     Public Function SetPosition(Optional ByVal Horizontal As StringAlignment = StringAlignment.Center, Optional ByVal Vertical As StringAlignment = StringAlignment.Center) As StringFormat
  409.         Return New StringFormat() With {.Alignment = Horizontal, .LineAlignment = Vertical}
  410.     End Function
  411.  
  412.     ''' <summary>
  413.     ''' The Matrix array of single from color.
  414.     ''' </summary>
  415.     ''' <param name="C">The Color.</param>
  416.     ''' <returns>The Matrix array of single from the given color</returns>
  417.     Function ColorToMatrix(ByVal C As Color) As Single()()
  418.         Return New Single()() {
  419.             New Single() {Convert.ToSingle(C.R / 255), 0, 0, 0, 0}, _
  420.             New Single() {0, Convert.ToSingle(C.G / 255), 0, 0, 0}, _
  421.             New Single() {0, 0, Convert.ToSingle(C.B / 255), 0, 0}, _
  422.             New Single() {0, 0, 0, Convert.ToSingle(C.A / 255), 0}, _
  423.             New Single() {Convert.ToSingle(C.R / 255), Convert.ToSingle(C.G / 255), Convert.ToSingle(C.B / 255), 0.0F, Convert.ToSingle(C.A / 255)}}
  424.     End Function
  425.  
  426.     ''' <summary>
  427.     ''' The Image from encoded base64 image.
  428.     ''' </summary>
  429.     ''' <param name="Base64Image">The Encoded base64 image</param>
  430.     ''' <returns>The Image from encoded base64.</returns>
  431.     Public Function ImageFromBase64(ByVal Base64Image As String) As Image
  432.         Using ms As New System.IO.MemoryStream(Convert.FromBase64String(Base64Image))
  433.             Return Image.FromStream(ms)
  434.         End Using
  435.     End Function
  436.  
  437.  
  438. #End Region
  439.  
  440. #Region " Round Border "
  441.  
  442.     ''' <summary>
  443.     ''' Credits : AeonHack
  444.     ''' </summary>
  445.  
  446.     Public Function RoundRec(ByVal r As Rectangle, ByVal Curve As Integer, _
  447.                                  Optional ByVal TopLeft As Boolean = True, Optional ByVal TopRight As Boolean = True, _
  448.                                  Optional ByVal BottomLeft As Boolean = True, Optional ByVal BottomRight As Boolean = True) As GraphicsPath
  449.         Dim CreateRoundPath As New GraphicsPath(FillMode.Winding)
  450.         If TopLeft Then
  451.             CreateRoundPath.AddArc(r.X, r.Y, Curve, Curve, 180.0F, 90.0F)
  452.         Else
  453.             CreateRoundPath.AddLine(r.X, r.Y, r.X, r.Y)
  454.         End If
  455.         If TopRight Then
  456.             CreateRoundPath.AddArc(r.Right - Curve, r.Y, Curve, Curve, 270, 90)
  457.         Else
  458.             CreateRoundPath.AddLine(r.Right - r.Width, r.Y, r.Width, r.Y)
  459.         End If
  460.         If BottomRight Then
  461.             CreateRoundPath.AddArc(r.Right - Curve, r.Bottom - Curve, Curve, Curve, 0.0F, 90)
  462.         Else
  463.             CreateRoundPath.AddLine(r.Right, r.Bottom, r.Right, r.Bottom)
  464.  
  465.         End If
  466.         If BottomLeft Then
  467.             CreateRoundPath.AddArc(r.X, (r.Bottom + r.Y) - Curve , Curve, Curve, 90, 90)
  468.         Else
  469.             CreateRoundPath.AddLine(r.X, r.Bottom, r.X, r.Bottom)
  470.         End If
  471.         CreateRoundPath.CloseFigure()
  472.         Return CreateRoundPath
  473.     End Function
  474.  
  475. #End Region
  476.  
  477. End Module
  478.  
  479. #End Region
  480.  
  481. #Region " TabControl "
  482.  
  483. Public Class YoutubeTabControl : Inherits TabControl
  484.  
  485. #Region " Declarations "
  486.  
  487.     Private R As Rectangle
  488.     Private _LocatedPostion, _ImageLocation, _TextLocation, _HeaderTextLocation As Point
  489.  
  490.  
  491. #End Region
  492.  
  493. #Region " Constructors "
  494.  
  495.     Sub New()
  496.         SetStyle(ControlStyles.UserPaint Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.SupportsTransparentBackColor, True)
  497.         DoubleBuffered = True
  498.         UpdateStyles()
  499.         SizeMode = TabSizeMode.Fixed
  500.         Dock = DockStyle.None
  501.         ItemSize = New Size(38, 180)
  502.         Alignment = TabAlignment.Left
  503.         Font = New Font("Myriad Pro", 9)
  504.         _LocatedPostion = New Point(-1, -1)
  505.         _ImageLocation = New Point(30, 13)
  506.         _TextLocation = New Point(50, 2)
  507.         _HeaderTextLocation = New Point(16, 5)
  508.     End Sub
  509.  
  510. #End Region
  511.  
  512. #Region " Events "
  513.  
  514.     Protected Overrides Sub OnCreateControl()
  515.         For Each Tab As TabPage In TabPages
  516.             Tab.BackColor = Colors.LightSilver
  517.             Invalidate()
  518.         Next
  519.         MyBase.OnCreateControl()
  520.     End Sub
  521.  
  522.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  523.         If DesignMode Then Return
  524.         _LocatedPostion = e.Location
  525.         Cursor = Cursors.Hand
  526.         Invalidate()
  527.         MyBase.OnMouseMove(e)
  528.     End Sub
  529.  
  530.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  531.         _LocatedPostion = New Point(-1, -1)
  532.         Cursor = Cursors.Default
  533.         Invalidate()
  534.         MyBase.OnMouseLeave(e)
  535.     End Sub
  536.  
  537. #End Region
  538.  
  539. #Region " Properties "
  540.  
  541.     <Category("Custom"),
  542.     Description("Gets or sets the tab pages image location.")>
  543.     Public Property ImageLocation As Point
  544.         Get
  545.             Return _ImageLocation
  546.         End Get
  547.         Set(value As Point)
  548.             _ImageLocation = value
  549.             Invalidate()
  550.         End Set
  551.     End Property
  552.  
  553.     <Category("Custom"),
  554.      Description("Gets or sets the tab pages text location.")>
  555.     Public Property TextLocation As Point
  556.         Get
  557.             Return _TextLocation
  558.         End Get
  559.         Set(value As Point)
  560.             _TextLocation = value
  561.             Invalidate()
  562.         End Set
  563.     End Property
  564.  
  565.     <Category("Custom"),
  566.      Description("Gets or sets the tab pages header text location.")>
  567.     Public Property HeaderTextLocation As Point
  568.         Get
  569.             Return _HeaderTextLocation
  570.         End Get
  571.         Set(value As Point)
  572.             _HeaderTextLocation = value
  573.             Invalidate()
  574.         End Set
  575.     End Property
  576.  
  577. #End Region
  578.  
  579. #Region " Draw Control "
  580.  
  581.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  582.         Dim G As Graphics = e.Graphics
  583.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  584.         G.InterpolationMode = InterpolationMode.HighQualityBicubic
  585.  
  586.         G.FillRectangle(Brushes.White, New Rectangle(0, 0, ItemSize.Height, Height))
  587.         G.FillRectangle(Brushes.LightSilver, New Rectangle(ItemSize.Height, 0, Width, Height))
  588.         Using SF As New StringFormat() With {.LineAlignment = StringAlignment.Center}
  589.  
  590.             For i As Integer = 0 To TabCount - 1
  591.  
  592.                 R = GetTabRect(i)
  593.  
  594.                 If Not TabPages(i).Tag Is Nothing Then
  595.  
  596.                     Using F As New Font(Font.Name, 9, FontStyle.Bold)
  597.  
  598.                         G.DrawString(TabPages(i).Text.ToUpper(), F, Brushes.Red, New Rectangle(R.X + HeaderTextLocation.X, R.Y + HeaderTextLocation.Y, R.Width - 2, R.Height), SF)
  599.  
  600.                     End Using
  601.  
  602.                 ElseIf i = SelectedIndex Then
  603.  
  604.                     G.FillRectangle(Brushes.Red, New Rectangle(R.X - 2, R.Y + 2, R.Width - 1, R.Height - 2))
  605.  
  606.                     G.DrawString(TabPages(i).Text, Font, Brushes.White, New Rectangle(R.X + TextLocation.X, R.Y + TextLocation.Y, R.Width - 2, R.Height), SF)
  607.  
  608.                 Else
  609.  
  610.                     If R.Contains(_LocatedPostion) Then
  611.  
  612.                         G.FillRectangle(Brushes.Gray, New Rectangle(R.X - 2, R.Y + 2, R.Width - 1, R.Height - 2))
  613.  
  614.                         G.DrawString(TabPages(i).Text, Font, Brushes.White, New Rectangle(R.X + TextLocation.X, R.Y + TextLocation.Y, R.Width - 2, R.Height), SF)
  615.  
  616.                     Else
  617.  
  618.                         G.DrawString(TabPages(i).Text, Font, Brushes.Gray, New Rectangle(R.X + TextLocation.X, R.Y + TextLocation.Y, R.Width - 2, R.Height), SF)
  619.  
  620.                     End If
  621.  
  622.                 End If
  623.  
  624.                 If Not ImageList Is Nothing AndAlso ImageList.Images(i) IsNot Nothing AndAlso TabPages(i).Tag Is Nothing Then
  625.  
  626.                     DrawImageWithColor(G, New Rectangle(R.X + ImageLocation.X, R.Y + ImageLocation.Y, 13, 13), ImageList.Images(i), If(i = SelectedIndex OrElse R.Contains(_LocatedPostion), Colors.White, Colors.Gray))
  627.  
  628.                 End If
  629.  
  630.             Next
  631.  
  632.         End Using
  633.  
  634.     End Sub
  635.  
  636. #End Region
  637.  
  638. End Class
  639.  
  640. Public Class YoutubeHorizontalTabControl : Inherits TabControl
  641.  
  642.     #Region " Declarations "
  643.  
  644.     Private _LocatedPostion As Point
  645.     Private R As Rectangle
  646.  
  647.     #End Region
  648.  
  649.     #Region " Constructors "
  650.  
  651.     Sub New()
  652.         SetStyle(ControlStyles.UserPaint Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.SupportsTransparentBackColor, True)
  653.         DoubleBuffered = True
  654.         UpdateStyles()
  655.         SizeMode = TabSizeMode.Fixed
  656.         Dock = DockStyle.None
  657.         ItemSize = New Size(90, 48)
  658.         Alignment = TabAlignment.Top
  659.         Font = New Font("Myriad Pro", 9)
  660.         _LocatedPostion = New Point(-1, -1)
  661.     End Sub
  662.  
  663. #End Region
  664.  
  665.     #Region " Events "
  666.  
  667.     Protected Overrides Sub OnCreateControl()
  668.         For Each Tab As TabPage In TabPages
  669.             Tab.BackColor = Colors.White
  670.             Invalidate()
  671.         Next
  672.         MyBase.OnCreateControl()
  673.     End Sub
  674.    
  675.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  676.         If DesignMode Then Return
  677.         _LocatedPostion = e.Location
  678.         Cursor = Cursors.Hand
  679.         Invalidate()
  680.         MyBase.OnMouseMove(e)
  681.     End Sub
  682.  
  683.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  684.         _LocatedPostion = New Point(-1, -1)
  685.         Cursor = Cursors.Default
  686.         Invalidate()
  687.         MyBase.OnMouseLeave(e)
  688.     End Sub
  689.  
  690. #End Region
  691.  
  692.     #Region " Properties "
  693.  
  694. #End Region
  695.  
  696.     #Region " Draw Control "
  697.  
  698.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  699.         Dim G As Graphics = e.Graphics
  700.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  701.         G.InterpolationMode = InterpolationMode.HighQualityBilinear
  702.         G.CompositingQuality = CompositingQuality.HighQuality
  703.  
  704.         G.FillRectangle(Brushes.White, New Rectangle(0,0,Width,ItemSize.Height))
  705.         G.FillRectangle(Brushes.White, New Rectangle(0,ItemSize.Height +3,Width,Height))
  706.         Using SF As New StringFormat() With {.LineAlignment = StringAlignment.Center}
  707.  
  708.             For i As Integer = 0 To TabCount - 1
  709.  
  710.                 R = GetTabRect(i)
  711.  
  712.                 If i = SelectedIndex Then
  713.  
  714.                     G.FillRectangle(Brushes.Red,New Rectangle(R.X-2,R.Height-4,R.Width-1,4))
  715.  
  716.                     G.DrawString(TabPages(i).Text,Font,Brushes.DarkGray,R,SetPosition())
  717.  
  718.                 Else
  719.  
  720.                     If R.Contains(_LocatedPostion) Then
  721.  
  722.                         G.DrawString(TabPages(i).Text,Font,Brushes.DarkGray,R,SetPosition())
  723.  
  724.                     Else
  725.  
  726.                         G.DrawString(TabPages(i).Text,Font,Brushes.Gray,R,SetPosition())
  727.  
  728.                     End If
  729.  
  730.                 End If
  731.             Next
  732.  
  733.         End Using
  734.  
  735.     End Sub
  736.  
  737. #End Region
  738.  
  739. End Class
  740.  
  741. #End Region
  742.  
  743. #Region " Button "
  744.  
  745.     Public Class YoutubeButton : Inherits Control
  746.  
  747.     #Region " Declarations "
  748.  
  749.     Private State As MouseMode
  750.     Private _Style As iStyle
  751.     Private _BorderRadius As Integer
  752.  
  753. #End Region
  754.  
  755.     #Region " Constructors "
  756.  
  757.     Sub New()
  758.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.SupportsTransparentBackColor,True)
  759.         DoubleBuffered=True
  760.         UpdateStyles()
  761.         BackColor=Color.Transparent
  762.         Font = New Font("Segoe UI",10)
  763.         _BorderRadius = 0
  764.         _Style = iStyle.Light
  765.         State = MouseMode.Normal
  766.     End Sub
  767.  
  768. #End Region
  769.  
  770.     #Region " Events "
  771.  
  772.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  773.         MyBase.OnMouseDown(e)
  774.         State = MouseMode.Pushed
  775.         Cursor = Cursors.Hand
  776.         Invalidate()
  777.     End Sub
  778.  
  779.     Protected Overrides Sub OnMouseHover(e As EventArgs)
  780.         MyBase.OnMouseHover(e)
  781.         State = MouseMode.Hovered
  782.         Cursor = Cursors.Hand
  783.         Invalidate()
  784.     End Sub
  785.  
  786.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  787.         MyBase.OnMouseLeave(e)
  788.         State = MouseMode.Normal
  789.         Cursor = Cursors.Default
  790.         Invalidate()
  791.     End Sub
  792.  
  793.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  794.         MyBase.OnMouseUp(e)
  795.         State = MouseMode.Hovered
  796.         Cursor = Cursors.Hand
  797.         Invalidate()
  798.     End Sub
  799.  
  800.  
  801. #End Region
  802.  
  803.     #Region " Properties "
  804.  
  805.     <Category("Custom"), _
  806.     Description("Gets or sets the style for the control.")>
  807.     Public Property Style As iStyle
  808.         Get
  809.             Return _Style
  810.         End Get
  811.         Set(value As iStyle)
  812.             _Style=value
  813.             Invalidate()
  814.         End Set
  815.     End Property
  816.  
  817.     <Category("Custom"),Description("Gets or sets the rounded corner degree of the control.")>
  818.     Public Property BorderRadius As Integer
  819.         Get
  820.             Return _BorderRadius
  821.         End Get
  822.         Set(value As Integer)
  823.             _BorderRadius=value
  824.             Invalidate()
  825.         End Set
  826.     End Property
  827.    
  828. #End Region
  829.  
  830.     #Region " Draw Control "
  831.  
  832.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  833.         Dim G As Graphics = e.Graphics,Rect As New Rectangle(0,0,Width-1,Height-1)
  834.         G.TextRenderingHint=TextRenderingHint.ClearTypeGridFit
  835.         Dim GP As New GraphicsPath()
  836.  
  837.             If BorderRadius > 1 Then
  838.                 G.SmoothingMode = SmoothingMode.AntiAlias
  839.                 GP = RoundRec(Rect, BorderRadius)
  840.             Else
  841.                 GP.AddRectangle(Rect)
  842.             End If
  843.  
  844.             Select Case State
  845.                 Case MouseMode.Normal
  846.                     G.FillPath(If(Style = iStyle.Light,Brushes.LightSilver,Brushes.Blue),GP)
  847.                     G.DrawPath(If(Style = iStyle.Light,Pens.Silver,Pens.LighterBlue),GP)
  848.                     G.DrawString(Text,Font,If(Style = iStyle.Light,Brushes.Gray,Brushes.White),Rect,SetPosition())
  849.                 Case MouseMode.Hovered
  850.                     G.FillPath(If(Style = iStyle.Light,Brushes.Silver,Brushes.LighterBlue),GP)
  851.                     G.DrawPath(If(Style = iStyle.Light,Pens.Silver,Pens.Blue),GP)
  852.                     G.DrawString(Text,Font,If(Style = iStyle.Light,Brushes.Gray,Brushes.White),Rect,SetPosition())
  853.                 Case MouseMode.Pushed
  854.                     G.FillPath(If(Style = iStyle.Light,Brushes.LightGray,Brushes.DarkBlue),GP)
  855.                     G.DrawPath(If(Style = iStyle.Light,Pens.Silver,Pens.DarkBlue),GP)
  856.                     G.DrawString(Text,Font,If(Style = iStyle.Light,Brushes.Gray,Brushes.White),Rect,SetPosition())
  857.             End Select
  858.  
  859.     End Sub
  860.  
  861. #End Region
  862.  
  863.     #Region " Enumerators "
  864.  
  865.     enum iStyle
  866.         Light
  867.         Blue
  868.     End enum
  869.  
  870. #End Region
  871.  
  872.     End Class
  873.  
  874.  
  875. #End Region
  876.  
  877. #Region " ButtonX "
  878.  
  879.     Public Class YoutubeButtonX : Inherits Control
  880.  
  881.     #Region " Declarations "
  882.  
  883.     Private _LeftText,_RightText As String
  884.     Private RedPart,LightPart As Rectangle
  885.     Private State As MouseMode
  886.     Private _Style As iStyle
  887.  
  888. #End Region
  889.  
  890.     #Region " Constructors "
  891.  
  892.     Sub New()
  893.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.SupportsTransparentBackColor,True)
  894.         DoubleBuffered=True
  895.         UpdateStyles()
  896.         BackColor=Color.Transparent
  897.         Font = New Font("Segoe UI",10)
  898.         _Style = iStyle.Red
  899.         State = MouseMode.Normal
  900.         _LeftText= "12,961,386"
  901.         _RightText = "Subscribe"
  902.     End Sub
  903.  
  904. #End Region
  905.  
  906.     #Region " Events "
  907.  
  908.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  909.         MyBase.OnMouseDown(e)
  910.         State = MouseMode.Pushed
  911.         Cursor = Cursors.Hand
  912.         Invalidate()
  913.     End Sub
  914.  
  915.     Protected Overrides Sub OnMouseHover(e As EventArgs)
  916.         MyBase.OnMouseHover(e)
  917.         State = MouseMode.Hovered
  918.         Cursor = Cursors.Hand
  919.         Invalidate()
  920.     End Sub
  921.  
  922.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  923.         MyBase.OnMouseLeave(e)
  924.         State = MouseMode.Normal
  925.         Cursor = Cursors.Default
  926.         Invalidate()
  927.     End Sub
  928.  
  929.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  930.         MyBase.OnMouseUp(e)
  931.         State = MouseMode.Hovered
  932.         Cursor = Cursors.Hand
  933.         Invalidate()
  934.     End Sub
  935.  
  936.  
  937. #End Region
  938.  
  939.     #Region " Properties "
  940.  
  941.     <Category("Custom"), _
  942.     Description("Gets or sets the style for the control.")>
  943.     Public Property Style As iStyle
  944.         Get
  945.             Return _Style
  946.         End Get
  947.         Set(value As iStyle)
  948.             _Style=value
  949.             Invalidate()
  950.         End Set
  951.     End Property
  952.  
  953.     <Category("Custom"), _
  954.     Description("Gets or sets the text of the left side of the control.")>
  955.     Public Property LeftText As String
  956.         Get
  957.             Return _LeftText
  958.         End Get
  959.         Set(value As String)
  960.             _LeftText=value
  961.             Invalidate()
  962.         End Set
  963.     End Property
  964.    
  965.     <Category("Custom"), _
  966.     Description("Gets or sets the text of the right side of the control.")>
  967.     Public Property RightText As String
  968.         Get
  969.             Return _RightText
  970.         End Get
  971.         Set(value As String)
  972.             _RightText=value
  973.             Invalidate()
  974.         End Set
  975.     End Property
  976.  
  977. #End Region
  978.  
  979.     #Region " Draw Control "
  980.  
  981.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  982.         Dim G As Graphics = e.Graphics,Rect As New Rectangle(0,0,Width-1,Height-1)
  983.         G.TextRenderingHint=TextRenderingHint.ClearTypeGridFit
  984.         G.SmoothingMode=SmoothingMode.AntiAlias
  985.         RedPart = New Rectangle(0,0,Width / 2,Height)
  986.         LightPart = New Rectangle(Width / 2,0,Width - Width / 2, Height)
  987.  
  988.         Select Case State
  989.  
  990.             Case MouseMode.Normal
  991.                 G.FillPath(If(Style = iStyle.Red,Brushes.Red,Brushes.Blue),RoundRec(RedPart,6,True,False,True,False))
  992.                 G.FillRectangle(Brushes.LightSilver,LightPart)
  993.                 G.DrawLine(Pens.Silver,Convert.ToInt32(Width / 2),0,Convert.ToInt32(Width - 1),0)
  994.                 G.DrawLine(Pens.Silver, Convert.ToInt32(Width / 2), Height - 1, Width, Height - 1)
  995.                 G.DrawLine(Pens.Silver, Width - 1, 0, Width - 1, Height)
  996.                 G.DrawString(RightText,Font,Brushes.White,RedPart,SetPosition())
  997.                 G.DrawString(LeftText,Font,Brushes.Gray,LightPart,SetPosition())
  998.             Case MouseMode.Hovered
  999.                 G.FillPath(If(Style = iStyle.Red,Brushes.LightRed,Brushes.LighterBlue),RoundRec(RedPart,6,True,False,True,False))
  1000.                 G.FillRectangle(Brushes.LightSilver,LightPart)
  1001.                 G.DrawLine(Pens.Silver,Convert.ToInt32(Width / 2),0,Convert.ToInt32(Width - 1),0)
  1002.                 G.DrawLine(Pens.Silver, Convert.ToInt32(Width / 2), Height - 1, Width, Height - 1)
  1003.                 G.DrawLine(Pens.Silver, Width - 1, 0, Width - 1, Height)
  1004.                 G.DrawString(RightText,Font,Brushes.White,RedPart,SetPosition())
  1005.                 G.DrawString(LeftText,Font,Brushes.Gray,LightPart,SetPosition())
  1006.             Case MouseMode.Pushed
  1007.                 G.FillPath(If(Style = iStyle.Red,Brushes.DarkRed,Brushes.DarkBlue),RoundRec(RedPart,6,True,False,True,False))
  1008.                 G.FillRectangle(Brushes.LightSilver,LightPart)
  1009.                 G.DrawLine(Pens.Silver,Convert.ToInt32(Width / 2),0,Convert.ToInt32(Width - 1),0)
  1010.                 G.DrawLine(Pens.Silver, Convert.ToInt32(Width / 2), Height - 1, Width, Height - 1)
  1011.                 G.DrawLine(Pens.Silver, Width - 1, 0, Width - 1, Height)
  1012.                 G.DrawString(RightText,Font,Brushes.White,RedPart,SetPosition())
  1013.                 G.DrawString(LeftText,Font,Brushes.Gray,LightPart,SetPosition())
  1014.         End Select
  1015.  
  1016.     End Sub
  1017.  
  1018. #End Region
  1019.  
  1020.     #Region " Enumerators "
  1021.  
  1022.     enum iStyle
  1023.         Blue
  1024.         Red
  1025.     End enum
  1026.  
  1027. #End Region
  1028.  
  1029.     End Class
  1030.  
  1031.  
  1032. #End Region
  1033.  
  1034. #Region " TextBox "
  1035.  
  1036. <DefaultEvent("TextChanged")> Public Class YoutubeTextbox : Inherits Control
  1037.  
  1038. #Region " Declarations "
  1039.  
  1040.     Private WithEvents T As New TextBox()
  1041.     Private _TextAlign As HorizontalAlignment
  1042.     Private _MaxLength As Integer
  1043.     Private _ReadOnly,_Multiline,_UseSystemPasswordChar As Boolean
  1044.     Private _Image As Image
  1045.     Private State As MouseMode
  1046.     Private _AutoCompleteSource As AutoCompleteSource,_AutoCompleteMode As AutoCompleteMode
  1047.     Private _AutoCompleteCustomSource As AutoCompleteStringCollection
  1048.     Private _Lines As String(),_WatermarkText As String
  1049.  
  1050. #End Region
  1051.  
  1052. #Region " Native Methods "
  1053.  
  1054.     Private Declare Auto Function SendMessage Lib "user32.dll" (hWnd As IntPtr, msg As Integer, wParam As Integer, <System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)> lParam As String) As Int32
  1055.  
  1056. #End Region
  1057.  
  1058. #Region " Properties "
  1059.  
  1060.     <Browsable(False), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
  1061.     ReadOnly Property BorderStyle As BorderStyle
  1062.         Get
  1063.             Return BorderStyle.None
  1064.         End Get
  1065.     End Property
  1066.  
  1067.     <Category("Custom"),
  1068.     Description("Gets or sets how text is aligned in TextBox control.")>
  1069.     Public Overloads Property TextAlign As HorizontalAlignment
  1070.         Get
  1071.             Return _TextAlign
  1072.         End Get
  1073.         Set(ByVal value As HorizontalAlignment)
  1074.             _TextAlign = value
  1075.             If T IsNot Nothing Then
  1076.                 T.TextAlign = value
  1077.             End If
  1078.             Invalidate()
  1079.         End Set
  1080.     End Property
  1081.  
  1082.     <Category("Custom"),
  1083.     Description("Gets or sets how text is aligned in TextBox control.")>
  1084.     Public Overloads Property MaxLength As Integer
  1085.         Get
  1086.             Return _MaxLength
  1087.         End Get
  1088.         Set(ByVal value As Integer)
  1089.             _MaxLength = value
  1090.             If T IsNot Nothing Then
  1091.                 T.MaxLength = value
  1092.             End If
  1093.             Invalidate()
  1094.         End Set
  1095.     End Property
  1096.  
  1097.     <Browsable(False), [ReadOnly](True)>
  1098.     Public Overloads ReadOnly Property BackColor As Color
  1099.         Get
  1100.             Return Color.Transparent
  1101.         End Get
  1102.     End Property
  1103.  
  1104.     <Category("Custom"),
  1105.     Description("Gets or sets the foreground color of the control.")>
  1106.     <Browsable(False), [ReadOnly](True)>
  1107.     Public Overloads ReadOnly Property ForeColor As Color
  1108.         Get
  1109.             Return Color.Transparent
  1110.         End Get
  1111.     End Property
  1112.  
  1113.     <Category("Custom"),
  1114.     Description("Gets or sets a value indicating whether text in the text box is read-only.")>
  1115.     Public Overloads Property [ReadOnly] As Boolean
  1116.         Get
  1117.             Return _ReadOnly
  1118.         End Get
  1119.         Set(ByVal value As Boolean)
  1120.             _ReadOnly = value
  1121.             If T IsNot Nothing Then
  1122.                 T.ReadOnly = value
  1123.             End If
  1124.         End Set
  1125.     End Property
  1126.  
  1127.     <Category("Custom"),
  1128.      Description("Gets or sets a value indicating whether the text in  TextBox control should appear as the default password character.")>
  1129.     Public Overloads Property UseSystemPasswordChar As Boolean
  1130.         Get
  1131.             Return _UseSystemPasswordChar
  1132.         End Get
  1133.         Set(ByVal value As Boolean)
  1134.             _UseSystemPasswordChar = value
  1135.             If T IsNot Nothing Then
  1136.                 T.UseSystemPasswordChar = value
  1137.             End If
  1138.         End Set
  1139.     End Property
  1140.  
  1141.     <Category("Custom"),
  1142.      Description("Gets or sets a value indicating whether this is a multiline System.Windows.Forms.TextBox control.")>
  1143.     Public Overloads Property Multiline As Boolean
  1144.         Get
  1145.             Return _Multiline
  1146.         End Get
  1147.         Set(value As Boolean)
  1148.             _Multiline = value
  1149.             If T Is Nothing Then Exit Property
  1150.             T.Multiline = value
  1151.             If value Then
  1152.                 T.Height = Height - 10
  1153.             Else
  1154.                 Height = T.Height + 10
  1155.             End If
  1156.         End Set
  1157.     End Property
  1158.  
  1159.     <Browsable(False), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
  1160.     Public Overloads ReadOnly Property BackgroundImage As Image
  1161.         Get
  1162.             Return Nothing
  1163.         End Get
  1164.     End Property
  1165.  
  1166.     <Category("Custom"),
  1167.     Description("Gets or sets the current text in  TextBox.")>
  1168.     Public Overloads Property Text As String
  1169.         Get
  1170.             Return MyBase.Text
  1171.         End Get
  1172.         Set(ByVal value As String)
  1173.             MyBase.Text = value
  1174.             If T IsNot Nothing Then
  1175.                 T.Text = value
  1176.             End If
  1177.         End Set
  1178.     End Property
  1179.  
  1180.     <Category("Custom"),
  1181.      Description("Gets or sets the text in the System.Windows.Forms.TextBox while being empty.")>
  1182.     Public Property WatermarkText As String
  1183.         Get
  1184.             Return _WatermarkText
  1185.         End Get
  1186.         Set(value As String)
  1187.             _WatermarkText = value
  1188.             SendMessage(T.Handle, 5377, 0, value)
  1189.             Invalidate()
  1190.         End Set
  1191.     End Property
  1192.  
  1193.     <Category("Custom"),
  1194.     Description("Gets or sets the image of the control.")>
  1195.     Public Property Image As Image
  1196.         Get
  1197.             Return _Image
  1198.         End Get
  1199.         Set(value As Image)
  1200.             _Image = value
  1201.             Invalidate()
  1202.         End Set
  1203.     End Property
  1204.  
  1205.     <Category("Custom"),
  1206.     Description("Gets or sets a value specifying the source of complete strings used for automatic completion.")>
  1207.     Public Property AutoCompleteSource As AutoCompleteSource
  1208.         Get
  1209.             Return _AutoCompleteSource
  1210.         End Get
  1211.         Set(value As AutoCompleteSource)
  1212.             _AutoCompleteSource = value
  1213.             If T IsNot Nothing Then
  1214.                 T.AutoCompleteSource = value
  1215.             End If
  1216.             Invalidate()
  1217.         End Set
  1218.     End Property
  1219.  
  1220.     <Category("Custom"),
  1221.     Description("Gets or sets a value specifying the source of complete strings used for automatic completion.")>
  1222.     Public Property AutoCompleteCustomSource As AutoCompleteStringCollection
  1223.         Get
  1224.             Return _AutoCompleteCustomSource
  1225.         End Get
  1226.         Set(value As AutoCompleteStringCollection)
  1227.             _AutoCompleteCustomSource = value
  1228.             If T IsNot Nothing Then
  1229.                 T.AutoCompleteCustomSource = value
  1230.             End If
  1231.             Invalidate()
  1232.         End Set
  1233.     End Property
  1234.  
  1235.     <Category("Custom"),
  1236.     Description("Gets or sets an option that controls how automatic completion works for the TextBox.")>
  1237.     Public Property AutoCompleteMode As AutoCompleteMode
  1238.         Get
  1239.             Return _AutoCompleteMode
  1240.         End Get
  1241.         Set(value As AutoCompleteMode)
  1242.             _AutoCompleteMode = value
  1243.             If T IsNot Nothing Then
  1244.                 T.AutoCompleteMode = value
  1245.             End If
  1246.             Invalidate()
  1247.         End Set
  1248.     End Property
  1249.  
  1250.     <Category("Custom"),
  1251.     Description("Gets or sets the font of the text displayed by the control.")>
  1252.     Public Overloads Property Font As Font
  1253.         Get
  1254.             Return MyBase.Font
  1255.         End Get
  1256.         Set(ByVal value As Font)
  1257.             MyBase.Font = value
  1258.             If T Is Nothing Then Exit Property
  1259.             T.Font = value
  1260.             T.Location = New Point(5, 5)
  1261.             T.Width = Width - 8
  1262.             If Not Multiline Then Height = T.Height + 11
  1263.         End Set
  1264.     End Property
  1265.  
  1266.     <Category("Custom"),
  1267.     Description("Gets or sets the lines of text in the control.")>
  1268.     Public Property Lines As String()
  1269.         Get
  1270.             Return _Lines
  1271.         End Get
  1272.         Set(value As String())
  1273.             _Lines = value
  1274.             If T Is Nothing Then Exit Property
  1275.             T.Lines = value
  1276.             Invalidate()
  1277.         End Set
  1278.     End Property
  1279.    
  1280.     <Category("Custom"),
  1281.     Description("Gets or sets the ContextMenuStrip associated with this control.")>
  1282.     Public Overrides Property ContextMenuStrip As ContextMenuStrip
  1283.         Get
  1284.             Return MyBase.ContextMenuStrip
  1285.         End Get
  1286.         Set(value As ContextMenuStrip)
  1287.             MyBase.ContextMenuStrip = value
  1288.             If T Is Nothing Then Return
  1289.             T.ContextMenuStrip = value
  1290.             Invalidate()
  1291.         End Set
  1292.     End Property
  1293.    
  1294. #End Region
  1295.  
  1296. #Region " Constructors "
  1297.  
  1298.     Sub New()
  1299.         SetStyle(ControlStyles.UserPaint Or _
  1300.                   ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
  1301.                   ControlStyles.SupportsTransparentBackColor, True)
  1302.         DoubleBuffered = True
  1303.         UpdateStyles()
  1304.         _MaxLength = 32767
  1305.         _TextAlign = HorizontalAlignment.Left
  1306.         _ReadOnly = False
  1307.         _UseSystemPasswordChar = False
  1308.         _WatermarkText = String.Empty
  1309.         _Image = Nothing
  1310.         State = MouseMode.Normal
  1311.         _AutoCompleteSource = AutoCompleteSource.None
  1312.         _AutoCompleteMode = AutoCompleteMode.None
  1313.         _Multiline = False
  1314.         _Lines = Nothing
  1315.         Font = New Font("Segoe UI", 10)
  1316.         With T
  1317.             .Multiline = False
  1318.             .Cursor = Cursors.IBeam
  1319.             .BackColor = Colors.White
  1320.             .ForeColor = Colors.Silver
  1321.             .BorderStyle = BorderStyle.None
  1322.             .Location = New Point(7, 8)
  1323.             .Font = Font
  1324.             .UseSystemPasswordChar = UseSystemPasswordChar
  1325.         End With
  1326.         Size = New Size(135, 30)
  1327.         If Multiline Then
  1328.             T.Height = Height - 11
  1329.         Else
  1330.             Height = T.Height + 11
  1331.         End If
  1332.     End Sub
  1333.  
  1334. #End Region
  1335.  
  1336. #Region " Events "
  1337.  
  1338.     Public Shadows Event TextChanged As TextChangedEventHandler
  1339.     Public Delegate Sub TextChangedEventHandler(sender As Object)
  1340.  
  1341.     Protected Overrides Sub OnCreateControl()
  1342.         MyBase.OnCreateControl()
  1343.         If Not Controls.Contains(T) Then Controls.Add(T)
  1344.     End Sub
  1345.  
  1346.     Protected Overrides Sub OnResize(e As EventArgs)
  1347.         MyBase.OnResize(e)
  1348.         T.Size = New Size(Width - 10, Height - 10)
  1349.     End Sub
  1350.  
  1351. #Region " TextBox MouseEvents "
  1352.  
  1353.     Private Sub T_MouseLeave(ByVal sender As Object, e As EventArgs) Handles T.MouseLeave
  1354.         State = MouseMode.Normal
  1355.         Invalidate()
  1356.     End Sub
  1357.  
  1358.     Private Sub T_MouseEnter(ByVal sender As Object, e As EventArgs) Handles T.MouseEnter, T.MouseDown, T.MouseHover
  1359.         State = MouseMode.Pushed
  1360.         Invalidate()
  1361.     End Sub
  1362.    
  1363.     Private Sub T_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles T.TextChanged
  1364.         Text = T.Text
  1365.         RaiseEvent TextChanged(Me)
  1366.         Invalidate()
  1367.     End Sub
  1368.  
  1369.     Private Sub T_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles T.KeyDown
  1370.         If e.Control AndAlso e.KeyCode = Keys.A Then e.SuppressKeyPress = True
  1371.         If e.Control AndAlso e.KeyCode = Keys.C Then
  1372.             T.Copy()
  1373.             e.SuppressKeyPress = True
  1374.         End If
  1375.         State = MouseMode.Pushed
  1376.         Invalidate()
  1377.     End Sub
  1378.  
  1379. #End Region
  1380.  
  1381. #End Region
  1382.  
  1383. #Region " Draw Control "
  1384.  
  1385.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  1386.         Dim G As Graphics = e.Graphics
  1387.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  1388.  
  1389.         Dim GP As New GraphicsPath, Rect As New Rectangle(0, 0, Width - 1, Height - 1)
  1390.  
  1391.         GP.AddRectangle(Rect)
  1392.  
  1393.         GP.CloseFigure()
  1394.         Using B As New PathGradientBrush(GP) With {.CenterColor= Colors.White,.SurroundColors= new Color(){Colors.LightSilver},.FocusScales = New PointF(0.98F, 0.75F)}, P As New Pen(Colors.Silver), P2 As New Pen(Colors.Blue)
  1395.             Select Case State
  1396.                 Case MouseMode.Normal
  1397.                     G.FillRectangle(B, Rect)
  1398.                     G.DrawRectangle(P, Rect)
  1399.                 Case MouseMode.Pushed
  1400.                     G.FillRectangle(B, Rect)
  1401.                     G.DrawRectangle(P2, Rect)
  1402.             End Select
  1403.  
  1404.         End Using
  1405.  
  1406.         If Not Image Is Nothing Then
  1407.             T.Location = New Point(31, 5)
  1408.             T.Width = Width - 60
  1409.             G.InterpolationMode = InterpolationMode.HighQualityBicubic
  1410.             G.DrawImage(Image, New Rectangle(8, 6, 16, 16))
  1411.         Else
  1412.  
  1413.             T.Location = New Point(7, 5)
  1414.             T.Width = Width - 10
  1415.  
  1416.         End If
  1417.  
  1418.         GP.Dispose()
  1419.  
  1420.     End Sub
  1421.  
  1422. #End Region
  1423.  
  1424. End Class
  1425.  
  1426. #End Region
  1427.  
  1428. #Region " Seperator "
  1429.  
  1430. Public Class YoutubeSeperator : Inherits Control
  1431.  
  1432. #Region " Variables "
  1433.  
  1434.     Private _SeperatorStyle As Style
  1435.     Private _SeperatorColor As Color
  1436.  
  1437. #End Region
  1438.  
  1439. #Region " Enumerators "
  1440.  
  1441.     Enum Style
  1442.         Horizental
  1443.         Vertiacal
  1444.     End Enum
  1445.  
  1446. #End Region
  1447.  
  1448. #Region " Properties "
  1449.  
  1450.     <Category("Custom"),
  1451.     Description("Gets or sets the style for the control.")>
  1452.     Public Property SeperatorStyle As Style
  1453.         Get
  1454.             Return _SeperatorStyle
  1455.         End Get
  1456.         Set(value As Style)
  1457.             _SeperatorStyle = value
  1458.             Invalidate()
  1459.         End Set
  1460.     End Property
  1461.  
  1462.     <Category("Custom"),
  1463.     Description("Gets or sets the color for the control.")>
  1464.     Public Property SeperatorColor As Color
  1465.         Get
  1466.             Return _SeperatorColor
  1467.         End Get
  1468.         Set(value As Color)
  1469.             _SeperatorColor = value
  1470.             Invalidate()
  1471.         End Set
  1472.     End Property
  1473.  
  1474. #End Region
  1475.  
  1476. #Region " Constructors "
  1477.  
  1478.     Sub New()
  1479.         SetStyle(ControlStyles.SupportsTransparentBackColor Or ControlStyles.UserPaint, True)
  1480.         DoubleBuffered = True
  1481.         UpdateStyles()
  1482.         BackColor = Color.Transparent
  1483.         _SeperatorStyle = Style.Horizental
  1484.         _SeperatorColor = Colors.Silver
  1485.     End Sub
  1486.  
  1487. #End Region
  1488.  
  1489. #Region " Draw Control "
  1490.  
  1491.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  1492.         Dim G As Graphics = e.Graphics
  1493.         Using P As New Pen(SeperatorColor)
  1494.             Select Case SeperatorStyle
  1495.                 Case Style.Horizental
  1496.                     G.DrawLine(P, 0, 1, Width, 1)
  1497.                 Case Style.Vertiacal
  1498.                     G.DrawLine(P, 1, 0, 1, Height)
  1499.             End Select
  1500.         End Using
  1501.  
  1502.     End Sub
  1503.  
  1504. #End Region
  1505.  
  1506. #Region " Events "
  1507.  
  1508.     Protected Overrides Sub OnResize(e As EventArgs)
  1509.         MyBase.OnResize(e)
  1510.         If SeperatorStyle = Style.Horizental Then
  1511.             Height = 4
  1512.         Else
  1513.             Width = 4
  1514.         End If
  1515.     End Sub
  1516.  
  1517. #End Region
  1518.  
  1519. End Class
  1520.  
  1521. #End Region
  1522.  
  1523. #Region " Label "
  1524.  
  1525. <DefaultEvent("TextChanged")> Public Class YoutubeLabel : Inherits Control
  1526.  
  1527. #Region " Draw Cotnrol "
  1528.  
  1529.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  1530.         e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  1531.         Using TB As New SolidBrush(ForeColor)
  1532.             e.Graphics.DrawString(Text, Font, TB, ClientRectangle)
  1533.         End Using
  1534.     End Sub
  1535.  
  1536. #End Region
  1537.  
  1538. #Region " Constructors "
  1539.  
  1540.     Sub New()
  1541.         SetStyle(ControlStyles.SupportsTransparentBackColor Or ControlStyles.UserPaint Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.OptimizedDoubleBuffer, True)
  1542.         DoubleBuffered = True
  1543.         UpdateStyles()
  1544.         BackColor = Color.Transparent
  1545.         ForeColor = Color.Silver
  1546.         Font = New Font("Myriad Pro", 10)
  1547.     End Sub
  1548.  
  1549. #End Region
  1550.  
  1551. #Region " Events "
  1552.  
  1553.     Public Shadows Event TextChanged As TextChangedEventHandler
  1554.     Public Delegate Sub TextChangedEventHandler(sender As Object)
  1555.  
  1556.     Protected Overrides Sub OnResize(e As EventArgs)
  1557.         Height = Font.Height
  1558.     End Sub
  1559.  
  1560.     Protected Overrides Sub OnTextChanged(e As EventArgs)
  1561.         MyBase.OnTextChanged(e)
  1562.         RaiseEvent TextChanged(me)
  1563.         Invalidate()
  1564.     End Sub
  1565.  
  1566. #End Region
  1567.  
  1568. End Class
  1569.  
  1570. #End Region
  1571.  
  1572. #Region " Link Label "
  1573. Class YoutubeLinkLabel : Inherits LinkLabel
  1574.  
  1575. #Region " Constructors "
  1576.  
  1577.     Sub New()
  1578.         Font = New Font("Myriad Pro", 10)
  1579.         BackColor = Color.Transparent
  1580.         LinkColor = Colors.Blue
  1581.         ActiveLinkColor = Color.FromArgb(40, 113, 164)
  1582.         VisitedLinkColor = Color.FromArgb(29, 83, 120)
  1583.         LinkBehavior = LinkBehavior.HoverUnderline
  1584.     End Sub
  1585.    
  1586. #End Region
  1587.  
  1588. End Class
  1589.  
  1590. #End Region
  1591.  
  1592. #Region " Progress "
  1593.  
  1594. <DefaultEvent("ValueChanged"), DefaultProperty("Value")> Public Class YoutubeProgressBar : Inherits Control
  1595.  
  1596. #Region " Declarations "
  1597.  
  1598.     Private _Value,_Maximum As Integer
  1599.     Event ValueChanged(sender As Object)
  1600.     Private _Style As iStyle
  1601.  
  1602. #End Region
  1603.  
  1604. #Region " Constructors "
  1605.  
  1606.     Sub New()
  1607.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or ControlStyles.ResizeRedraw Or
  1608.                        ControlStyles.OptimizedDoubleBuffer Or ControlStyles.SupportsTransparentBackColor, True)
  1609.         DoubleBuffered = True
  1610.         UpdateStyles()
  1611.         BackColor = Color.Transparent
  1612.         _Maximum = 100
  1613.         _Value = 0
  1614.         _Style = iStyle.Red
  1615.     End Sub
  1616.  
  1617. #End Region
  1618.  
  1619. #Region " Properties "
  1620.  
  1621.     <Category("Custom"),
  1622.     Description("Gets or sets the current position of the progressbar.")>
  1623.     Public Property Value As Integer
  1624.         Get
  1625.             If _Value < 0 Then
  1626.                 Return 0
  1627.             Else
  1628.                 Return _Value
  1629.             End If
  1630.         End Get
  1631.         Set(ByVal Value As Integer)
  1632.             If Value > Maximum Then
  1633.                 Value = Maximum
  1634.             End If
  1635.             _Value = Value
  1636.             RaiseEvent ValueChanged(Me)
  1637.             Invalidate()
  1638.         End Set
  1639.     End Property
  1640.  
  1641.     <Category("Custom"),
  1642.     Description("Gets or sets the maximum value of the progressbar.")>
  1643.     Public Property Maximum As Integer
  1644.         Get
  1645.             Return _Maximum
  1646.         End Get
  1647.         Set(ByVal Value As Integer)
  1648.             Select Case Value
  1649.                 Case Is < _Value
  1650.                     _Value = Value
  1651.             End Select
  1652.             _Maximum = Value
  1653.             Invalidate()
  1654.         End Set
  1655.     End Property
  1656.        
  1657.     <Category("Custom"), _
  1658.     Description("Gets or sets the style for the control.")>
  1659.     Public Property Style As iStyle
  1660.         Get
  1661.             Return _Style
  1662.         End Get
  1663.         Set(value As iStyle)
  1664.             _Style=value
  1665.             Invalidate()
  1666.         End Set
  1667.     End Property
  1668.    
  1669. #End Region
  1670.  
  1671. #Region " Draw Control "
  1672.  
  1673.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  1674.  
  1675.         Dim G As Graphics = e.Graphics, GP As New GraphicsPath
  1676.  
  1677.         Dim CurrentValue As Integer = Convert.ToInt32(Value / Maximum * Width)
  1678.         Dim Rect As New Rectangle(0, 0, Width, Height)
  1679.  
  1680.         G.FillRectangle(Brushes.LightGray,Rect)
  1681.  
  1682.         If Not CurrentValue = 0 Then
  1683.  
  1684.             G.FillRectangle(if(Style=iStyle.Red,Brushes.Red,Brushes.Blue),New Rectangle(Rect.X, Rect.Y, CurrentValue, Rect.Height))
  1685.            
  1686.         End If
  1687.  
  1688.         GP.Dispose()
  1689.     End Sub
  1690.  
  1691. #End Region
  1692.  
  1693. #Region " Enumerators "
  1694.  
  1695.     enum iStyle
  1696.         Red
  1697.         Blue
  1698.     End enum
  1699.  
  1700. #End Region
  1701.  
  1702. End Class
  1703.  
  1704. #End Region
  1705.  
  1706. #Region " CheckBox "
  1707.  
  1708. <DefaultEvent("CheckedChanged"),DefaultProperty("Checked")>
  1709. Public Class YoutubeCheckBox : Inherits Control
  1710.  
  1711. #Region " Declarations "
  1712.  
  1713.     Private _Checked As Boolean
  1714.     Protected State As MouseMode = MouseMode.Normal
  1715.  
  1716. #End Region
  1717.  
  1718. #Region " Properties "
  1719.  
  1720.     <Category("Custom"),
  1721.     Description("Gets or set a value indicating whether the control is in the checked state.")>
  1722.     Property Checked As Boolean
  1723.         Get
  1724.             Return _Checked
  1725.         End Get
  1726.         Set(ByVal value As Boolean)
  1727.             _Checked = value
  1728.             RaiseEvent CheckedChanged(Me)
  1729.             Invalidate()
  1730.         End Set
  1731.     End Property
  1732.  
  1733. #End Region
  1734.  
  1735. #Region " Constructors "
  1736.  
  1737.     Sub New()
  1738.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.OptimizedDoubleBuffer Or
  1739.      ControlStyles.SupportsTransparentBackColor Or ControlStyles.UserPaint, True)
  1740.         DoubleBuffered = True
  1741.         Cursor = Cursors.Hand
  1742.         BackColor = Color.Transparent
  1743.         ForeColor = Color.FromArgb(121, 121, 121)
  1744.         Font = New Font("Segoe UI", 9)
  1745.         UpdateStyles()
  1746.     End Sub
  1747.  
  1748. #End Region
  1749.  
  1750. #Region " Draw Control "
  1751.  
  1752.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  1753.         Dim G As Graphics = e.Graphics
  1754.         G.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit
  1755.         Dim rect As New Rectangle(0, 0, 18, 17)
  1756.         Using F As New Font("Marlett", 14)
  1757.             G.FillRectangle(Brushes.LighterSilver, rect)
  1758.             if Checked Then G.DrawString("b", F, Brushes.Gray, New Rectangle(-2, 0, Width, Height))
  1759.             G.DrawRectangle(Pens.Silver, New Rectangle(0, 0, 17, 16))
  1760.             G.DrawString(Text, Font, Brushes.Gray, New Rectangle(18, 2, Width, Height - 4), SetPosition(StringAlignment.Near))
  1761.         End Using
  1762.  
  1763.     End Sub
  1764.  
  1765. #End Region
  1766.  
  1767. #Region " Events "
  1768.  
  1769.     Event CheckedChanged(ByVal sender As Object)
  1770.  
  1771.     Protected Overrides Sub OnClick(ByVal e As EventArgs)
  1772.         _Checked = Not Checked
  1773.         RaiseEvent CheckedChanged(Me)
  1774.         MyBase.OnClick(e)
  1775.         Invalidate()
  1776.     End Sub
  1777.  
  1778.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  1779.         Invalidate() : MyBase.OnTextChanged(e)
  1780.     End Sub
  1781.  
  1782.     Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  1783.         MyBase.OnResize(e)
  1784.         Height = 17
  1785.         Invalidate()
  1786.     End Sub
  1787.  
  1788.     Protected Overrides Sub OnMouseHover(e As EventArgs)
  1789.         MyBase.OnMouseHover(e)
  1790.         State = MouseMode.Hovered
  1791.         Invalidate()
  1792.     End Sub
  1793.  
  1794.     Protected Overrides Sub OnMouseLeave(e As EventArgs)
  1795.         MyBase.OnMouseLeave(e)
  1796.         State = MouseMode.Normal
  1797.         Invalidate()
  1798.     End Sub
  1799.  
  1800.     Protected Overrides Sub OnHandleCreated(e As EventArgs)
  1801.         MyBase.OnHandleCreated(e)
  1802.     End Sub
  1803.  
  1804. #End Region
  1805.  
  1806. End Class
  1807.  
  1808. #End Region
  1809.  
  1810. #Region " RadioButton "
  1811.  
  1812. <DefaultEvent("CheckedChanged"), DefaultProperty("Checked")> Public Class YoutubeRadioButton : Inherits Control
  1813.  
  1814. #Region " Declarations "
  1815.  
  1816.     Private _Checked As Boolean
  1817.     Protected _Group As Integer
  1818.  
  1819. #End Region
  1820.  
  1821. #Region " Properties "
  1822.  
  1823.     <Category("Custom"),
  1824.     Description("Gets or set a value indicating whether the control is in the checked state.")>
  1825.     Property Checked As Boolean
  1826.         Get
  1827.             Return _Checked
  1828.         End Get
  1829.         Set(ByVal value As Boolean)
  1830.             _Checked = value
  1831.             RaiseEvent CheckedChanged(Me)
  1832.             Invalidate()
  1833.         End Set
  1834.     End Property
  1835.  
  1836.     <Category("Custom")>
  1837.     Property Group As Integer
  1838.         Get
  1839.             Return _Group
  1840.         End Get
  1841.         Set(ByVal value As Integer)
  1842.             _Group = value
  1843.             Invalidate()
  1844.         End Set
  1845.     End Property
  1846.  
  1847. #End Region
  1848.  
  1849. #Region " Constructors "
  1850.  
  1851.     Sub New()
  1852.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.OptimizedDoubleBuffer Or
  1853.     ControlStyles.SupportsTransparentBackColor Or ControlStyles.UserPaint, True)
  1854.         DoubleBuffered = True
  1855.         UpdateStyles()
  1856.         Cursor = Cursors.Hand
  1857.         BackColor = Color.Transparent
  1858.         ForeColor = Color.FromArgb(121, 121, 121)
  1859.         Font = New Font("Segoe UI", 9, FontStyle.Regular)
  1860.         Group = 1
  1861.     End Sub
  1862.  
  1863. #End Region
  1864.  
  1865. #Region " Draw Control "
  1866.  
  1867.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  1868.         Dim G As Graphics = e.Graphics
  1869.         G.SmoothingMode = SmoothingMode.AntiAlias
  1870.         G.TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit
  1871.  
  1872.         Using F As New Font("Marlett", 14)
  1873.             G.FillEllipse(Brushes.LighterSilver, New Rectangle(0, 0, 21, 21))
  1874.             if Checked Then G.FillEllipse(Brushes.Gray, New Rectangle(5, 5, 10, 10))
  1875.             G.DrawString(Text, Font, Brushes.Gray, New Rectangle(21, 1, Width, Height - 2), SetPosition(StringAlignment.Near))
  1876.             G.DrawEllipse(Pens.Silver, New Rectangle(0, 0, 20, 20))
  1877.         End Using
  1878.  
  1879.     End Sub
  1880.  
  1881. #End Region
  1882.  
  1883. #Region " Events "
  1884.  
  1885.     Event CheckedChanged(ByVal sender As Object)
  1886.  
  1887.     Private Sub UpdateState()
  1888.         If Not IsHandleCreated OrElse Not Checked Then Return
  1889.         For Each C As Control In Parent.Controls
  1890.             If C IsNot Me AndAlso TypeOf C Is YoutubeRadioButton AndAlso DirectCast(C, YoutubeRadioButton).Group = _Group Then
  1891.                 DirectCast(C, YoutubeRadioButton).Checked = False
  1892.             End If
  1893.         Next
  1894.     End Sub
  1895.  
  1896.     Protected Overrides Sub OnClick(ByVal e As EventArgs)
  1897.         _Checked = Not Checked
  1898.         UpdateState()
  1899.         MyBase.OnClick(e)
  1900.         Invalidate()
  1901.     End Sub
  1902.  
  1903.     Protected Overrides Sub OnCreateControl()
  1904.         UpdateState()
  1905.         MyBase.OnCreateControl()
  1906.     End Sub
  1907.  
  1908.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  1909.         Invalidate() : MyBase.OnTextChanged(e)
  1910.     End Sub
  1911.  
  1912.     Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  1913.         MyBase.OnResize(e)
  1914.         Height = 22
  1915.         Invalidate()
  1916.     End Sub
  1917.  
  1918. #End Region
  1919.  
  1920. End Class
  1921.  
  1922. #End Region
  1923.  
  1924. #Region " ComboBox "
  1925.  
  1926. <DefaultEvent("SelectedIndexChanged")> Public Class YoutubeComboBox : Inherits ComboBox
  1927.  
  1928. #Region " Declarations "
  1929.  
  1930.     Private _StartIndex As Integer = 0
  1931.     Shadows Event SelectedIndexChanged(ByVal sender As object)
  1932.  
  1933. #End Region
  1934.  
  1935. #Region " Constructors "
  1936.  
  1937.     Sub New()
  1938.  
  1939.         SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint Or _
  1940.                   ControlStyles.OptimizedDoubleBuffer Or ControlStyles.SupportsTransparentBackColor, True)
  1941.         BackColor = Color.Transparent
  1942.         Font = New Font("Segoe UI", 11)
  1943.         DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
  1944.         DoubleBuffered = True
  1945.         StartIndex = 0
  1946.         DropDownStyle = ComboBoxStyle.DropDownList
  1947.         UpdateStyles()
  1948.     End Sub
  1949.  
  1950. #End Region
  1951.  
  1952. #Region " Properties "
  1953.  
  1954.     <Category("Custom Properties"),
  1955.     Description("Gets or sets the index specifying the currently selected item.")>
  1956.     Private Property StartIndex As Integer
  1957.         Get
  1958.             Return _StartIndex
  1959.         End Get
  1960.         Set(ByVal value As Integer)
  1961.             _StartIndex = value
  1962.             Try
  1963.                 MyBase.SelectedIndex = value
  1964.                 RaiseEvent SelectedIndexChanged(Me)
  1965.             Catch
  1966.             End Try
  1967.             Invalidate()
  1968.         End Set
  1969.     End Property
  1970.  
  1971. #End Region
  1972.  
  1973. #Region " Draw Control "
  1974.  
  1975.     Protected Overrides Sub OnDrawItem(e As DrawItemEventArgs)
  1976.         Dim G As Graphics = e.Graphics
  1977.         G.TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit
  1978.         Try
  1979.  
  1980.             Using BG As New SolidBrush(If((e.State And DrawItemState.Selected) = DrawItemState.Selected, Colors.Gray, Colors.White)), TC As New SolidBrush(If((e.State And DrawItemState.Selected) = DrawItemState.Selected, Colors.White, Colors.Gray)),F As New Font(Font.Name,9)
  1981.                 G.FillRectangle(BG, e.Bounds)
  1982.                 G.DrawString(GetItemText(Items(e.Index)), F, TC, e.Bounds)
  1983.             End Using
  1984.  
  1985.         Catch
  1986.         End Try
  1987.  
  1988.     End Sub
  1989.  
  1990.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  1991.         Dim G As Graphics = e.Graphics
  1992.  
  1993.         G.TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit
  1994.         Dim GP As New GraphicsPath, Rect As New Rectangle(0, 0, Width - 1, Height - 1)
  1995.         GP.AddRectangle(Rect)
  1996.         GP.CloseFigure()
  1997.         Using B As New PathGradientBrush(GP) With {.CenterColor= Colors.White,.SurroundColors= new Color(){Colors.LightSilver},.FocusScales = New PointF(0.98F, 0.75F)}
  1998.             G.FillPath(B, GP)
  1999.             G.DrawPath(Pens.Silver, GP)
  2000.         End Using
  2001.  
  2002.         G.SmoothingMode = SmoothingMode.AntiAlias
  2003.  
  2004.         DrawTriangle(G, Colors.Silver, 1.5, _
  2005.                   New Point(Width - 20, 12), New Point(Width - 16, 16), _
  2006.                   New Point(Width - 16, 16), New Point(Width - 12, 12), _
  2007.                   New Point(Width - 16, 17), New Point(Width - 16, 16) _
  2008.                   )
  2009.         G.SmoothingMode = SmoothingMode.None
  2010.         Using F As New Font(Font.Name,10)
  2011.             G.DrawString(Text, F, Brushes.Silver, New Rectangle(7, 0, Width - 1, Height - 1), SetPosition(StringAlignment.Near))
  2012.         End Using
  2013.         GP.Dispose()
  2014.     End Sub
  2015.  
  2016. #End Region
  2017.  
  2018. #Region " Events "
  2019.  
  2020.     Protected Overrides Sub OnResize(e As EventArgs)
  2021.         MyBase.OnResize(e)
  2022.         Invalidate()
  2023.     End Sub
  2024.  
  2025. #End Region
  2026.  
  2027. End Class
  2028.  
  2029. #End Region
  2030.  
  2031. #Region " GroupBox "
  2032.  
  2033. Public Class YouTubeGroupBox : Inherits ContainerControl
  2034.  
  2035.     #Region " Declarations "
  2036.    
  2037.     Private R As Rectangle
  2038.     Private _Style As iStyle
  2039.  
  2040. #End Region
  2041.  
  2042.     #Region " Properties "
  2043.  
  2044.     <Category("Custom"),Description("Gets or sets the image of the control.")>Public Property Image As Image
  2045.  
  2046.     <Category("Custom"),
  2047.     Description("Gets or sets the style for the control.")>
  2048.     Public Property Style As iStyle
  2049.         Get
  2050.             Return _Style
  2051.         End Get
  2052.         Set(value As iStyle)
  2053.             _Style=value
  2054.             Invalidate()
  2055.         End Set
  2056.     End Property
  2057.  
  2058.  
  2059. #End Region
  2060.  
  2061.     #Region " Constructors "
  2062.  
  2063.     Sub New()
  2064.         SetStyle(ControlStyles.UserPaint Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.SupportsTransparentBackColor, True)
  2065.         DoubleBuffered = True
  2066.         Font = New Font("Segoe UI", 10)
  2067.         BackColor = Color.Transparent
  2068.         UpdateStyles()
  2069.         Image = Nothing
  2070.         _Style = iStyle.Blue
  2071.     End Sub
  2072.  
  2073. #End Region
  2074.    
  2075.     #Region " Draw Control "
  2076.  
  2077.     Protected Overrides Sub OnPaint(e As PaintEventArgs)
  2078.         Dim G As Graphics = e.Graphics
  2079.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
  2080.         Dim Rect As New Rectangle(0,0,Width-1,Height-1)
  2081.         R = New Rectangle(Width-30,15,20,20)
  2082.         G.FillRectangle(Brushes.White,Rect)
  2083.         G.FillRectangle(If(Style = iStyle.Blue,Brushes.Blue,Brushes.Red),New Rectangle(0,0,Width-1,50))
  2084.         G.DrawString(Text,Font,Brushes.White,New Rectangle(if(image Is Nothing,10,35),0,Width-1,50),SetPosition(StringAlignment.Near))
  2085.         If image IsNot Nothing Then DrawImageWithColor(G,New Rectangle(12,15,18,18),image,Colors.White)
  2086.         Using F As New Font(Font,FontStyle.Bold)
  2087.             G.DrawString("x",F,Brushes.White,R,SetPosition())
  2088.         End Using
  2089.        
  2090.         G.DrawRectangle(If(Style = iStyle.Blue,Pens.Blue,Pens.Red),Rect)
  2091.     End Sub
  2092.  
  2093. #End Region
  2094.  
  2095.     #Region " Events "
  2096.  
  2097.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  2098.         MyBase.OnMouseMove(e)
  2099.         If R.Contains(e.Location) Then
  2100.             Cursor = Cursors.Hand
  2101.         Else
  2102.             Cursor = Cursors.Default
  2103.         End If
  2104.     End Sub
  2105.  
  2106.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  2107.         MyBase.OnMouseDown(e)
  2108.         If e.Button =MouseButtons.Left AndAlso R.Contains(e.Location) Then
  2109.             Parent.Controls.Remove(Me)
  2110.         End If
  2111.     End Sub
  2112.  
  2113. #End Region
  2114.  
  2115.     #Region " Enumerators "
  2116.  
  2117.     enum iStyle
  2118.         Blue
  2119.         Red
  2120.     End enum
  2121.  
  2122. #End Region
  2123.  
  2124. End Class
  2125.  
  2126. #End Region
  2127.  
  2128. #Region " Colors & Brushes Pens "
  2129.  
  2130. Public NotInheritable Class Colors
  2131.  
  2132.     Public Shared ReadOnly  Property Red As Color
  2133.         Get
  2134.             Return Color.FromArgb(204, 24, 30)
  2135.         End Get
  2136.     End Property
  2137.        
  2138.     Public Shared ReadOnly  Property LightRed As Color
  2139.         Get
  2140.             Return Color.FromArgb(230, 33, 23)
  2141.         End Get
  2142.     End Property
  2143.                
  2144.     Public Shared ReadOnly  Property DarkRed As Color
  2145.         Get
  2146.             Return Color.FromArgb(179, 18, 23)
  2147.         End Get
  2148.     End Property
  2149.        
  2150.     Public Shared ReadOnly  Property Blue As Color
  2151.         Get
  2152.             Return Color.FromArgb(18, 109, 179)
  2153.         End Get
  2154.     End Property
  2155.    
  2156.     Public Shared ReadOnly  Property LighterBlue As Color
  2157.         Get
  2158.             Return Color.FromArgb(22, 122, 198)
  2159.         End Get
  2160.     End Property
  2161.        
  2162.     Public Shared ReadOnly  Property DarkBlue As Color
  2163.         Get
  2164.             Return Color.FromArgb(9, 91, 153)
  2165.         End Get
  2166.     End Property
  2167.    
  2168.     Public Shared ReadOnly  Property White As Color
  2169.         Get
  2170.             Return Color.White
  2171.         End Get
  2172.     End Property
  2173.        
  2174.     Public Shared ReadOnly  Property Silver As Color
  2175.         Get
  2176.             Return Color.FromArgb(211, 211, 211)
  2177.         End Get
  2178.     End Property
  2179.        
  2180.     Public Shared ReadOnly  Property LightSilver As Color
  2181.         Get
  2182.             Return Color.FromArgb(241, 241, 241)
  2183.         End Get
  2184.     End Property
  2185.        
  2186.     Public Shared ReadOnly  Property LighterSilver As Color
  2187.         Get
  2188.             Return Color.FromArgb(248, 248, 248)
  2189.         End Get
  2190.     End Property
  2191.  
  2192.     Public Shared ReadOnly  Property DarkGray As Color
  2193.         Get
  2194.             Return Color.FromArgb(51, 51, 51)
  2195.         End Get
  2196.     End Property
  2197.  
  2198.     Public Shared ReadOnly  Property Gray As Color
  2199.         Get
  2200.             Return Color.FromArgb(102, 102, 102)
  2201.         End Get
  2202.     End Property
  2203.    
  2204.     Public Shared ReadOnly  Property LightGray As Color
  2205.         Get
  2206.             Return Color.FromArgb(198, 198, 198)
  2207.         End Get
  2208.     End Property
  2209.    
  2210.     Public Shared ReadOnly  Property LighterGray As Color
  2211.         Get
  2212.             Return Color.FromArgb(233, 233, 233)
  2213.         End Get
  2214.     End Property
  2215.    
  2216. End Class
  2217.  
  2218. Public NotInheritable Class Brushes
  2219.  
  2220.     Public Shared ReadOnly  Property Red As SolidBrush
  2221.         Get
  2222.             Return New SolidBrush(Colors.Red)
  2223.         End Get
  2224.     End Property
  2225.            
  2226.     Public Shared ReadOnly  Property LightRed As SolidBrush
  2227.         Get
  2228.             Return New SolidBrush(Colors.LightRed)
  2229.         End Get
  2230.     End Property
  2231.                
  2232.     Public Shared ReadOnly  Property DarkRed As SolidBrush
  2233.         Get
  2234.             Return New SolidBrush(Colors.DarkRed)
  2235.         End Get
  2236.     End Property
  2237.        
  2238.     Public Shared ReadOnly  Property Blue As SolidBrush
  2239.         Get
  2240.             Return New SolidBrush(Colors.Blue)
  2241.         End Get
  2242.     End Property
  2243.        
  2244.     Public Shared ReadOnly  Property LighterBlue As SolidBrush
  2245.         Get
  2246.             Return New SolidBrush(Colors.LighterBlue)
  2247.         End Get
  2248.     End Property
  2249.            
  2250.     Public Shared ReadOnly  Property DarkBlue As SolidBrush
  2251.         Get
  2252.             Return New SolidBrush(Colors.DarkBlue)
  2253.         End Get
  2254.     End Property
  2255.    
  2256.     Public Shared ReadOnly  Property White As SolidBrush
  2257.         Get
  2258.             Return New SolidBrush(Colors.White)
  2259.         End Get
  2260.     End Property
  2261.        
  2262.     Public Shared ReadOnly  Property Silver As SolidBrush
  2263.         Get
  2264.             Return New SolidBrush(Colors.Silver)
  2265.         End Get
  2266.     End Property
  2267.        
  2268.     Public Shared ReadOnly  Property LightSilver As SolidBrush
  2269.         Get
  2270.             Return New SolidBrush(Colors.LightSilver)
  2271.         End Get
  2272.     End Property
  2273.        
  2274.     Public Shared ReadOnly  Property LighterSilver As SolidBrush
  2275.         Get
  2276.             Return New SolidBrush(Colors.LighterSilver)
  2277.         End Get
  2278.     End Property
  2279.  
  2280.     Public Shared ReadOnly  Property DarkGray As SolidBrush
  2281.         Get
  2282.             Return New SolidBrush(Colors.DarkGray)
  2283.         End Get
  2284.     End Property
  2285.  
  2286.     Public Shared ReadOnly Property Gray As SolidBrush
  2287.         Get
  2288.             Return New SolidBrush(Colors.Gray)
  2289.         End Get
  2290.     End Property
  2291.        
  2292.     Public Shared ReadOnly  Property LightGray As SolidBrush
  2293.         Get
  2294.             Return New SolidBrush(Colors.LightGray)
  2295.         End Get
  2296.     End Property
  2297.  
  2298.     Public Shared ReadOnly Property LighterGray As SolidBrush
  2299.         Get
  2300.             Return New SolidBrush(Colors.LighterGray)
  2301.         End Get
  2302.     End Property
  2303.  
  2304. End Class
  2305.  
  2306. Public NotInheritable Class Pens
  2307.  
  2308.     Public Shared ReadOnly  Property Red As Pen
  2309.         Get
  2310.             Return New Pen(Colors.Red)
  2311.         End Get
  2312.     End Property
  2313.                    
  2314.     Public Shared ReadOnly  Property LightRed As Pen
  2315.         Get
  2316.             Return New Pen(Colors.LightRed)
  2317.         End Get
  2318.     End Property
  2319.                
  2320.     Public Shared ReadOnly  Property DarkRed As Pen
  2321.         Get
  2322.             Return new Pen(Colors.DarkRed)
  2323.         End Get
  2324.     End Property
  2325.        
  2326.     Public Shared ReadOnly  Property Blue As Pen
  2327.         Get
  2328.             Return New Pen(Colors.Blue)
  2329.         End Get
  2330.     End Property
  2331.            
  2332.     Public Shared ReadOnly  Property LighterBlue As Pen
  2333.         Get
  2334.             Return New Pen(Colors.LighterBlue)
  2335.         End Get
  2336.     End Property
  2337.                
  2338.     Public Shared ReadOnly  Property DarkBlue As Pen
  2339.         Get
  2340.             Return New Pen(Colors.DarkBlue)
  2341.         End Get
  2342.     End Property
  2343.    
  2344.     Public Shared ReadOnly  Property White As Pen
  2345.         Get
  2346.             Return New Pen(Colors.White)
  2347.         End Get
  2348.     End Property
  2349.        
  2350.     Public Shared ReadOnly  Property Silver As Pen
  2351.         Get
  2352.             Return New Pen(Colors.Silver)
  2353.         End Get
  2354.     End Property
  2355.        
  2356.     Public Shared ReadOnly  Property LightSilver As Pen
  2357.         Get
  2358.             Return New Pen(Colors.Gray)
  2359.         End Get
  2360.     End Property
  2361.        
  2362.     Public Shared ReadOnly  Property LighterSilver As Pen
  2363.         Get
  2364.             Return New Pen(Colors.LighterSilver)
  2365.         End Get
  2366.     End Property
  2367.  
  2368.     Public Shared ReadOnly  Property DarkGray As Pen
  2369.         Get
  2370.             Return New Pen(Colors.DarkGray)
  2371.         End Get
  2372.     End Property
  2373.  
  2374.     Public Shared ReadOnly Property Gray As Pen
  2375.         Get
  2376.             Return New Pen(Colors.Gray)
  2377.         End Get
  2378.     End Property
  2379.    
  2380.     Public Shared ReadOnly  Property LightGray As Pen
  2381.         Get
  2382.             Return New Pen(Colors.LightGray)
  2383.         End Get
  2384.     End Property
  2385.  
  2386.     Public Shared ReadOnly Property LighterGray As Pen
  2387.         Get
  2388.             Return New Pen(Colors.LighterGray)
  2389.         End Get
  2390.     End Property
  2391.  
  2392. End Class
  2393.  
  2394. #End Region
Add Comment
Please, Sign In to add comment