netrosly

Plistic Blue - GDI Theme

Feb 8th, 2015
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 48.97 KB | None | 0 0
  1. Imports System.ComponentModel
  2. Imports System.Drawing.Drawing2D
  3. '[--------------------]
  4. '[|by Nettro from HF |]
  5. '[|Hope you enjoy ;) |]
  6. '[|Feb 08, 2015      |]
  7. '[--------------------]
  8. Public Class PlisticBlueContainer
  9.     Inherits ContainerControl
  10.     Sub New()
  11.         Me.DoubleBuffered = True
  12.         Me.Dock = DockStyle.Fill
  13.     End Sub
  14.     <Category("Main Colors")>
  15.     Property Fill_Color As Color = Color.FromArgb(25, 38, 69)
  16.     <Category("Main Colors")>
  17.     Property header_Color As Color = Color.FromArgb(20, 30, 55)
  18.     <Category("Main Colors")>
  19.     Property icon_color As Color = Color.FromArgb(16, 24, 44)
  20.     <Category("Main Colors")>
  21.     Property Bottom_Color As Color = Color.FromArgb(20, 30, 55)
  22.     <Category("Main Colors")>
  23.     Property Lip_Color As Color = Color.FromArgb(15, 23, 41)
  24.     <Category("Form Text")>
  25.     Property Texxt_Color As Color = Color.FromArgb(245, 245, 25)
  26.     <Category("Form Text")>
  27.     Property Fonnt As Font = New Font("Arial", 16, FontStyle.Regular)
  28.     <Category("Form Text")>
  29.     Property Texxt As String = " - Sign In"
  30.     <Category("Header Text")>
  31.     Property Header_Fonnt As Font = New Font("Arial", 16, FontStyle.Bold)
  32.     <Category("Header Text")>
  33.     Property Header_Texxt As String = "PB"
  34.     <Category("Header Text")>
  35.     Property Header_Texxt_Color As Color = Color.FromArgb(0, 174, 85)
  36.     <Category("Bottom Text")>
  37.     Property Bottom_Fonnt As Font = New Font("Arial", 11, FontStyle.Regular)
  38.     <Category("Bottom Text")>
  39.     Property Bottom_Texxt As String = "   Don't have an account?"
  40.     <Category("Bottom Text")>
  41.     Property Bottom_Texxt_Color As Color = Color.FromArgb(166, 172, 192)
  42.     Private Sub PlisticBlueContainer_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  43.         e.Graphics.FillRectangle(New SolidBrush(Fill_Color), New Rectangle(0, 0, Me.Width, Me.Height))
  44.         e.Graphics.FillRectangle(New SolidBrush(header_Color), New Rectangle(0, 0, Me.Width - 52, 50))
  45.         e.Graphics.FillRectangle(New SolidBrush(icon_color), New Rectangle(Me.Width - 52, 0, 52, 50))
  46.         e.Graphics.FillRectangle(New SolidBrush(Bottom_Color), New Rectangle(0, Me.Height - 57, Me.Width, 50))
  47.         e.Graphics.FillRectangle(New SolidBrush(Lip_Color), New Rectangle(0, Me.Height - 7, Me.Width, 7))
  48.         Dim Textsz As SizeF = e.Graphics.MeasureString(Texxt, Fonnt)
  49.         e.Graphics.DrawString(Header_Texxt, Header_Fonnt, New SolidBrush(Header_Texxt_Color), New Rectangle(0, 0, (Me.Width - 52) - Textsz.Width, 50), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  50.         Dim Headersz As SizeF = e.Graphics.MeasureString(Header_Texxt, Header_Fonnt)
  51.         e.Graphics.DrawString(Texxt, Fonnt, New SolidBrush(Texxt_Color), New Rectangle(0, 0, (Me.Width - 52) + Headersz.Width, 50), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  52.         e.Graphics.DrawString(Bottom_Texxt, Bottom_Fonnt, New SolidBrush(Bottom_Texxt_Color), New Rectangle(0, Me.Height - 57, Me.Width, 50), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center})
  53.         e.Graphics.DrawImage(FindForm.Icon.ToBitmap, New Rectangle(Me.Width - 48, 4, 46, 46))
  54.     End Sub
  55. #Region "ThemeDraggable"
  56.     Dim x, y As Integer
  57.     Private savePoint As New Point(0, 0)
  58.     Private isDragging As Boolean = False
  59.  
  60.     Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
  61.         Dim dragRect As New Rectangle(0, 0, Me.Width, 50)
  62.         If dragRect.Contains(New Point(e.X, e.Y)) Then
  63.             isDragging = True
  64.             savePoint = New Point(e.X, e.Y)
  65.         End If
  66.         '
  67.         MyBase.OnMouseDown(e)
  68.     End Sub
  69.  
  70.     Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
  71.         isDragging = False
  72.         MyBase.OnMouseUp(e)
  73.     End Sub
  74.  
  75.     Private mouseX As Integer
  76.     Private mouseY As Integer
  77.     Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
  78.  
  79.         mouseX = e.X
  80.         mouseY = e.Y
  81.         If isDragging Then
  82.             Dim screenPoint As Point = PointToScreen(e.Location)
  83.  
  84.             FindForm().Location = New Point(screenPoint.X - Me.savePoint.X, screenPoint.Y - Me.savePoint.Y)
  85.         End If
  86.         MyBase.OnMouseMove(e)
  87.         Invalidate()
  88.     End Sub
  89.  
  90. #End Region
  91. End Class
  92. Public Class PlisticBlueButton
  93.     Inherits Control
  94.     Sub New()
  95.         Me.DoubleBuffered = True
  96.     End Sub
  97. #Region "Functions"
  98.     Public Sub FixRoundRectClicked(g As Graphics)
  99.         'Fix Top
  100.         'Line right
  101.         g.DrawLine(New Pen(Main_Color), New Point(Me.Width - 7, 2), New Point(Me.Width - 7, 7))
  102.         'Line left
  103.         g.DrawLine(New Pen(Main_Color), New Point(7, 2), New Point(7, 7))
  104.         'Long Line
  105.         g.DrawLine(New Pen(Main_Color), New Point(2, 7), New Point(Me.Width - 2, 7))
  106.         'Fix Bottom
  107.         'Line Bottom Right
  108.         ' g.DrawLine(New Pen(Under_Color), New Point(7, Me.Height - 2), New Point(7, Me.Height - 4))
  109.         'Line Bottom Left
  110.         ' g.DrawLine(New Pen(Under_Color), New Point(Me.Width - 7, Me.Height - 2), New Point(Me.Width - 7, Me.Height - 4))
  111.         'Line right
  112.         g.DrawLine(New Pen(Main_Color), New Point(Me.Width - 7, Me.Height - 2), New Point(Me.Width - 7, Me.Height - 6))
  113.         'Line left
  114.         g.DrawLine(New Pen(Main_Color), New Point(7, Me.Height - 2), New Point(7, Me.Height - 6))
  115.         'Long Line
  116.         g.DrawLine(New Pen(Main_Color), New Point(2, Me.Height - 7), New Point(Me.Width - 2, Me.Height - 7))
  117.     End Sub
  118.     Public Sub FixRoundRect(g As Graphics)
  119.         'Fix Top
  120.         'Line right
  121.         g.DrawLine(New Pen(Main_Color), New Point(Me.Width - 7, 2), New Point(Me.Width - 7, 7))
  122.         'Line left
  123.         g.DrawLine(New Pen(Main_Color), New Point(7, 2), New Point(7, 7))
  124.         'Long Line
  125.         g.DrawLine(New Pen(Main_Color), New Point(2, 7), New Point(Me.Width - 2, 7))
  126.         'Fix Bottom
  127.         'Line Bottom Right
  128.         g.DrawLine(New Pen(Under_Color), New Point(7, Me.Height - 2), New Point(7, Me.Height - 4))
  129.         'Line Bottom Left
  130.         g.DrawLine(New Pen(Under_Color), New Point(Me.Width - 7, Me.Height - 2), New Point(Me.Width - 7, Me.Height - 4))
  131.         'Line right
  132.         g.DrawLine(New Pen(Main_Color), New Point(Me.Width - 7, Me.Height - 6), New Point(Me.Width - 7, Me.Height - 11))
  133.         'Line left
  134.         g.DrawLine(New Pen(Main_Color), New Point(7, Me.Height - 6), New Point(7, Me.Height - 11))
  135.         'Long Line
  136.         g.DrawLine(New Pen(Main_Color), New Point(2, Me.Height - 11), New Point(Me.Width - 2, Me.Height - 11))
  137.     End Sub
  138.     Public Sub DrawRoundRect(g As Graphics, p As Pen, x As Single, y As Single, width As Single, height As Single, _
  139.       radius As Single)
  140.         Dim gp As New GraphicsPath()
  141.  
  142.         gp.AddLine(x + radius, y, x + width - (radius * 2), y)
  143.         ' Line
  144.         gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90)
  145.         ' Corner
  146.         gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2))
  147.         ' Line
  148.         gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, radius * 2, 0, 90)
  149.         ' Corner
  150.         gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height)
  151.         ' Line
  152.         gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90)
  153.         ' Corner
  154.         gp.AddLine(x, y + height - (radius * 2), x, y + radius)
  155.         ' Line
  156.         gp.AddArc(x, y, radius * 2, radius * 2, 180, 90)
  157.         ' Corner
  158.         gp.CloseFigure()
  159.  
  160.         g.DrawPath(p, gp)
  161.         gp.Dispose()
  162.     End Sub
  163.     Public Sub FillRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  164.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  165.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
  166.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  167.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  168.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  169.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  170.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  171.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  172.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  173.         g.SmoothingMode = mode
  174.     End Sub
  175.     Public Sub FillNotTopRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  176.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  177.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed
  178.         g.FillPie(b, r.X, r.Y, 1, 1, 180, 90)
  179.         g.FillPie(b, r.X + r.Width - d, r.Y, 1, 1, 270, 90)
  180.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  181.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  182.         ' g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  183.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  184.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  185.         g.SmoothingMode = mode
  186.     End Sub
  187.     Public Sub FillNotBottomRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  188.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  189.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
  190.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  191.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  192.         'g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  193.         '  g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  194.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  195.         ' g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  196.         '   g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  197.         g.SmoothingMode = mode
  198.     End Sub
  199. #End Region
  200. #Region "Properties"
  201.     <Category("Colors")>
  202.     Property Main_Color As Color = Color.FromArgb(166, 172, 192)
  203.     <Category("Colors")>
  204.     Property Under_Color As Color = Color.FromArgb(112, 116, 130)
  205.     <Category("Colors")>
  206.     Property Text_Color As Color = Color.FromArgb(22, 34, 59)
  207.     <Category("Colors")>
  208.     Property Back_color As Color = Color.FromArgb(22, 34, 59)
  209.     <Category("Text")>
  210.     Property Texxt As String = "Sign up"
  211.     <Category("Text")>
  212.     Property fonnt As Font = New Font("Arial", 11, FontStyle.Regular)
  213.     Dim inner As Boolean = True
  214.     Event Clicked()
  215.     Dim Cliccked As Boolean = False
  216. #End Region
  217.  
  218.  
  219.  
  220.     Private Sub PlisticBlueButton_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  221.         e.Graphics.SmoothingMode = SmoothingMode.AntiAlias
  222.         e.Graphics.Clear(Back_color)
  223.         If Cliccked = False Then
  224.             FillRoundedRectangle(e.Graphics, New Rectangle(1, 1, Me.Width - 2, Me.Height - 2), 12, New SolidBrush(Under_Color))
  225.             FillRoundedRectangle(e.Graphics, New Rectangle(1, 1, Me.Width - 2, Me.Height - 6), 12, New SolidBrush(Main_Color))
  226.             FixRoundRect(e.Graphics)
  227.             e.Graphics.DrawString(Texxt, fonnt, New SolidBrush(Text_Color), New Rectangle(1, 1, Me.Width - 2, Me.Height - 6), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  228.         Else
  229.             FillRoundedRectangle(e.Graphics, New Rectangle(1, 1, Me.Width - 2, Me.Height - 2), 12, New SolidBrush(Main_Color))
  230.             FixRoundRectClicked(e.Graphics)
  231.             FillRoundedRectangle(e.Graphics, New Rectangle(1, 1, Me.Width - 2, Me.Height - 2), 12, New SolidBrush(Color.FromArgb(90, 45, 45, 45)))
  232.             e.Graphics.DrawString(Texxt, fonnt, New SolidBrush(Text_Color), New Rectangle(1, 1, Me.Width - 2, Me.Height - 2), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  233.  
  234.         End If
  235.  
  236.     End Sub
  237. #Region "Mouse"
  238.     Dim tmr As New Timer
  239.     Private Sub PlisticBlueButton_MouseClick(sender As Object, e As MouseEventArgs) Handles Me.MouseClick
  240.         If e.Button = Windows.Forms.MouseButtons.Left Then
  241.             If New Rectangle(1, 1, Me.Width - 2, Me.Height - 6).Contains(e.X, e.Y) Then
  242.                 RaiseEvent Clicked()
  243.                 Cliccked = True
  244.                 Me.Refresh()
  245.                 tmr.Interval = 200
  246.                 AddHandler tmr.Tick, AddressOf tmr_tick
  247.                 tmr.Start()
  248.             End If
  249.         End If
  250.     End Sub
  251.  
  252.     Private Sub PlisticBlueButton_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove
  253.         If New Rectangle(1, 1, Me.Width - 2, Me.Height - 6).Contains(e.X, e.Y) Then
  254.             Cursor = Cursors.Hand
  255.             inner = True
  256.         Else
  257.             Cursor = Cursors.Arrow
  258.             inner = False
  259.         End If
  260.     End Sub
  261. #End Region
  262.  
  263.     Private Sub tmr_tick(sender As Object, e As EventArgs)
  264.         Cliccked = False
  265.         Me.Refresh()
  266.         tmr.Stop()
  267.     End Sub
  268.  
  269. End Class
  270. Public Class PlisticBlue_Seperator
  271.     Inherits Control
  272.     <Category("Colors")>
  273.     Property Main_Color As Color = Color.FromArgb(96, 105, 131)
  274.     <Category("Colors")>
  275.     Property Back_color As Color = Color.FromArgb(25, 38, 69)
  276.     <Category("Colors")>
  277.     Property Side_Color As Color = Color.FromArgb(0, 174, 85)
  278.     <Category("Misc")>
  279.     Property SubtractSep As Integer = 40
  280.     Sub New()
  281.         Me.DoubleBuffered = True
  282.         Me.Height = 6
  283.         Me.Width = 100
  284.     End Sub
  285.  
  286.     Private Sub PlisticBlue_Spe_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  287.         e.Graphics.Clear(Back_color)
  288.         e.Graphics.DrawLine(New Pen(Side_Color), New Point(3, Me.Height / 2), New Point(Me.Width - 4, Me.Height / 2))
  289.         e.Graphics.DrawLine(New Pen(Main_Color), New Point(SubtractSep - 1, Me.Height / 2), New Point(Me.Width - SubtractSep, Me.Height / 2))
  290.     End Sub
  291. End Class
  292. Public Class PlisticBlue_GroupBox
  293.     Inherits Panel
  294.     Sub New()
  295.         Me.DoubleBuffered = True
  296.         Me.Padding = New Padding(5, 5, 5, 5)
  297.     End Sub
  298.     Property Main_color As Color = Color.FromArgb(19, 28, 52)
  299.     Property back_color As Color = Color.FromArgb(25, 38, 69)
  300. #Region "Functions"
  301.     Public Sub FixRoundRectClicked(g As Graphics)
  302.         'Fix Top
  303.         'Line right
  304.         g.DrawLine(New Pen(Main_Color), New Point(Me.Width - 7, 2), New Point(Me.Width - 7, 7))
  305.         'Line left
  306.         g.DrawLine(New Pen(Main_Color), New Point(7, 2), New Point(7, 7))
  307.         'Long Line
  308.         g.DrawLine(New Pen(Main_Color), New Point(2, 7), New Point(Me.Width - 2, 7))
  309.         'Fix Bottom
  310.         'Line Bottom Right
  311.         ' g.DrawLine(New Pen(Under_Color), New Point(7, Me.Height - 2), New Point(7, Me.Height - 4))
  312.         'Line Bottom Left
  313.         ' g.DrawLine(New Pen(Under_Color), New Point(Me.Width - 7, Me.Height - 2), New Point(Me.Width - 7, Me.Height - 4))
  314.         'Line right
  315.         g.DrawLine(New Pen(Main_Color), New Point(Me.Width - 7, Me.Height - 2), New Point(Me.Width - 7, Me.Height - 6))
  316.         'Line left
  317.         g.DrawLine(New Pen(Main_Color), New Point(7, Me.Height - 2), New Point(7, Me.Height - 6))
  318.         'Long Line
  319.         g.DrawLine(New Pen(Main_Color), New Point(2, Me.Height - 7), New Point(Me.Width - 2, Me.Height - 7))
  320.     End Sub
  321.     Public Sub FixRoundRect(g As Graphics)
  322.         'Fix Top
  323.         'Line right
  324.         g.DrawLine(New Pen(Main_Color), New Point(Me.Width - 7, 2), New Point(Me.Width - 7, 7))
  325.         'Line left
  326.         g.DrawLine(New Pen(Main_Color), New Point(7, 2), New Point(7, 7))
  327.         'Long Line
  328.         g.DrawLine(New Pen(Main_Color), New Point(2, 7), New Point(Me.Width - 2, 7))
  329.         'Fix Bottom
  330.         'Line Bottom Right
  331.         ' g.DrawLine(New Pen(Under_Color), New Point(7, Me.Height - 2), New Point(7, Me.Height - 4))
  332.         'Line Bottom Left
  333.         'g.DrawLine(New Pen(Under_Color), New Point(Me.Width - 7, Me.Height - 2), New Point(Me.Width - 7, Me.Height - 4))
  334.         'Line right
  335.         g.DrawLine(New Pen(Main_Color), New Point(Me.Width - 7, Me.Height - 6), New Point(Me.Width - 7, Me.Height - 11))
  336.         'Line left
  337.         g.DrawLine(New Pen(Main_Color), New Point(7, Me.Height - 6), New Point(7, Me.Height - 11))
  338.         'Long Line
  339.         g.DrawLine(New Pen(Main_Color), New Point(2, Me.Height - 11), New Point(Me.Width - 2, Me.Height - 11))
  340.     End Sub
  341.     Public Sub DrawRoundRect(g As Graphics, p As Pen, x As Single, y As Single, width As Single, height As Single, _
  342.       radius As Single)
  343.         Dim gp As New GraphicsPath()
  344.  
  345.         gp.AddLine(x + radius, y, x + width - (radius * 2), y)
  346.         ' Line
  347.         gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90)
  348.         ' Corner
  349.         gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2))
  350.         ' Line
  351.         gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, radius * 2, 0, 90)
  352.         ' Corner
  353.         gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height)
  354.         ' Line
  355.         gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90)
  356.         ' Corner
  357.         gp.AddLine(x, y + height - (radius * 2), x, y + radius)
  358.         ' Line
  359.         gp.AddArc(x, y, radius * 2, radius * 2, 180, 90)
  360.         ' Corner
  361.         gp.CloseFigure()
  362.  
  363.         g.DrawPath(p, gp)
  364.         gp.Dispose()
  365.     End Sub
  366.     Public Sub FillRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  367.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  368.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
  369.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  370.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  371.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  372.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  373.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  374.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  375.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  376.         g.SmoothingMode = mode
  377.     End Sub
  378.     Public Sub FillNotTopRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  379.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  380.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed
  381.         g.FillPie(b, r.X, r.Y, 1, 1, 180, 90)
  382.         g.FillPie(b, r.X + r.Width - d, r.Y, 1, 1, 270, 90)
  383.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  384.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  385.         ' g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  386.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  387.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  388.         g.SmoothingMode = mode
  389.     End Sub
  390.     Public Sub FillNotBottomRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  391.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  392.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
  393.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  394.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  395.         'g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  396.         '  g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  397.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  398.         ' g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  399.         '   g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  400.         g.SmoothingMode = mode
  401.     End Sub
  402. #End Region
  403.  
  404.     Private Sub PlisticBlue_GroupBox_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  405.         e.Graphics.Clear(back_color)
  406.         FillRoundedRectangle(e.Graphics, New Rectangle(1, 1, Me.Width - 2, Me.Height - 2), 12, New SolidBrush(Main_color))
  407.         FixRoundRectClicked(e.Graphics)
  408.     End Sub
  409. End Class
  410. Public Class FluidButton
  411.     Inherits Control
  412.     Event Lefted_Clicked()
  413.     <Category("Animation")>
  414.     Property Animation As Boolean = False
  415.     <Category("Animation")>
  416.     Property CountMax As Integer = 120
  417.     <Category("Animation")>
  418.     Property Clicked As Boolean = False
  419.     <Category("Animation")>
  420.     Property CurrCount As Integer = 0
  421.     <Category("Animation")>
  422.     Property Shad As Integer = 20
  423.     <Category("Animation")>
  424.     Property StartShad As Integer = 20
  425.     <Category("Animation")>
  426.     Property SGD As Boolean = False
  427.     <Category("Animation")>
  428.     Property Momentum As Integer = 1
  429.     <Category("Animation")>
  430.     Property Speed As Integer = 20
  431.     <Category("Animation")>
  432.     Property Texxt As String = "Button"
  433.     <Category("Animation")>
  434.     Property StartSize As Size = New Size(30, 30)
  435.     <Category("Animation")>
  436.     Property MouseLoc As Point
  437.     <Category("Animation")>
  438.     Property PostSize As Size = New Size(30, 30)
  439.     <Category("Color")>
  440.     Property Main_color As Color = Color.FromArgb(166, 172, 192)
  441.     <Category("Color")>
  442.     Property Text_color As Color = Color.FromArgb(166, 172, 192)
  443.     <Category("Color")>
  444.     Property Back_color As Color = Color.FromArgb(25, 38, 69)
  445.     Property Fonnt As Font = New Font("Arial", 11, FontStyle.Regular)
  446.     Dim tmr As New Timer
  447. #Region "Mouse Events"
  448.     Private Sub FluidEngine_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove
  449.         If New Rectangle(2, 2, Me.Width - 2, Me.Height - 2).Contains(e.X, e.Y) Then
  450.             Cursor = Cursors.Hand
  451.         Else
  452.             Cursor = Cursors.Arrow
  453.         End If
  454.     End Sub
  455.     Private Sub FluidEngine_MouseDown(sender As Object, e As MouseEventArgs) Handles Me.MouseDown
  456.         'Reset
  457.         For Each tim As Timer In Me.Controls.OfType(Of Timer)()
  458.             tim.Dispose()
  459.         Next
  460.         tmr = New Timer
  461.         PostSize = StartSize
  462.         CurrCount = 0
  463.         Shad = StartShad
  464.         'Prepare
  465.         tmr.Interval = Speed
  466.         AddHandler tmr.Tick, AddressOf tmr_Tick
  467.         If Animation = True Then
  468.             If e.Button = Windows.Forms.MouseButtons.Left Then
  469.                 RaiseEvent Lefted_Clicked()
  470.                 Clicked = True
  471.                 MouseLoc = New Point(e.X, e.Y)
  472.                 tmr.Start()
  473.  
  474.             End If
  475.         End If
  476.     End Sub
  477. #End Region
  478.     Sub New()
  479.         Me.DoubleBuffered = True
  480.     End Sub
  481.  
  482.  
  483.  
  484.     Private Sub FluidEngine_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  485.         e.Graphics.Clear(Back_color)
  486.         e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
  487.         ' e.Graphics.DrawRectangle(Pens.Black, New Rectangle(0, 0, Me.Width - 1, Me.Height - 1))
  488.         e.Graphics.DrawString(Text, Fonnt, New SolidBrush(Text_color), New Rectangle(0, 0, Me.Width, Me.Height), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  489.         If Clicked = True Then
  490.             e.Graphics.FillEllipse(New SolidBrush(Color.FromArgb(Shad, Main_color)), New Rectangle(New Point(MouseLoc.X - (StartSize.Width + CurrCount) / 2, MouseLoc.Y - (StartSize.Height + CurrCount) / 2), New Point(StartSize.Width + CurrCount, StartSize.Height + CurrCount)))
  491.         End If
  492.  
  493.     End Sub
  494. #Region "Animation Timer"
  495.     Private Sub tmr_Tick(sender As Object, e As EventArgs)
  496.         If CurrCount = CountMax Then
  497.             tmr.Stop()
  498.             Clicked = False
  499.             Me.Refresh()
  500.         Else
  501.             If SGD = True Then
  502.                 If Not Shad = 255 Then
  503.                     Shad += Momentum
  504.                 End If
  505.             Else
  506.                 If Not Shad = 0 Then
  507.                     Shad -= Momentum
  508.                 End If
  509.             End If
  510.  
  511.             CurrCount += Momentum
  512.             Me.Refresh()
  513.         End If
  514.     End Sub
  515. #End Region
  516.  
  517. End Class
  518. Public Class PlisticBlue_Checkbox
  519.     Inherits Control
  520.     Sub New()
  521.         Me.DoubleBuffered = True
  522.         Me.Width = 100
  523.         Me.Height = 60
  524.     End Sub
  525.     <Category("Color")>
  526.     Property Border_color As Color = Color.FromArgb(166, 172, 192)
  527.     <Category("Color")>
  528.     Property Check_color As Color = Color.FromArgb(25, 38, 69)
  529.     <Category("Color")>
  530.     Property Checked_color As Color = Color.FromArgb(166, 172, 192)
  531.     <Category("Color")>
  532.     Property Text_color As Color = Color.FromArgb(166, 172, 192)
  533.     <Category("Color")>
  534.     Property Back_color As Color = Color.FromArgb(25, 38, 69)
  535.     Property Fonnt As Font = New Font("Arial", 11, FontStyle.Regular)
  536. #Region "Functions"
  537.     Public Sub FixRoundRectClicked(g As Graphics, rect As Rectangle)
  538.         'Fix Top
  539.         'Line right
  540.         g.DrawLine(New Pen(Checked_color), New Point(rect.Width - 7, 2), New Point(rect.Width - 7, 7))
  541.         'Line left
  542.         g.DrawLine(New Pen(Checked_color), New Point(7, 2), New Point(7, 7))
  543.         'Long Line
  544.         g.DrawLine(New Pen(Checked_color), New Point(2, 7), New Point(rect.Width - 2, 7))
  545.         'Fix Bottom
  546.         'Line Bottom Right
  547.         ' g.DrawLine(New Pen(Under_Color), New Point(7, Me.Height - 2), New Point(7, Me.Height - 4))
  548.         'Line Bottom Left
  549.         ' g.DrawLine(New Pen(Under_Color), New Point(Me.Width - 7, Me.Height - 2), New Point(Me.Width - 7, Me.Height - 4))
  550.         'Line right
  551.         g.DrawLine(New Pen(Checked_color), New Point(rect.Width - 7, rect.Height - 2), New Point(rect.Width - 7, rect.Height - 6))
  552.         'Line left
  553.         g.DrawLine(New Pen(Checked_color), New Point(7, rect.Height - 2), New Point(7, rect.Height - 6))
  554.         'Long Line
  555.         g.DrawLine(New Pen(Checked_color), New Point(2, rect.Height - 7), New Point(rect.Width - 2, rect.Height - 7))
  556.     End Sub
  557.     Public Sub FixRoundRect(g As Graphics)
  558.         'Fix Top
  559.         'Line right
  560.         g.DrawLine(New Pen(Checked_color), New Point(Me.Width - 7, 2), New Point(Me.Width - 7, 7))
  561.         'Line left
  562.         g.DrawLine(New Pen(Checked_color), New Point(7, 2), New Point(7, 7))
  563.         'Long Line
  564.         g.DrawLine(New Pen(Checked_color), New Point(2, 7), New Point(Me.Width - 2, 7))
  565.         'Fix Bottom
  566.         'Line Bottom Right
  567.         ' g.DrawLine(New Pen(Under_Color), New Point(7, Me.Height - 2), New Point(7, Me.Height - 4))
  568.         'Line Bottom Left
  569.         'g.DrawLine(New Pen(Under_Color), New Point(Me.Width - 7, Me.Height - 2), New Point(Me.Width - 7, Me.Height - 4))
  570.         'Line right
  571.         g.DrawLine(New Pen(Checked_color), New Point(Me.Width - 7, Me.Height - 6), New Point(Me.Width - 7, Me.Height - 11))
  572.         'Line left
  573.         g.DrawLine(New Pen(Checked_color), New Point(7, Me.Height - 6), New Point(7, Me.Height - 11))
  574.         'Long Line
  575.         g.DrawLine(New Pen(Checked_color), New Point(2, Me.Height - 11), New Point(Me.Width - 2, Me.Height - 11))
  576.     End Sub
  577.     Public Sub DrawRoundRect(g As Graphics, p As Pen, x As Single, y As Single, width As Single, height As Single, _
  578.       radius As Single)
  579.         Dim gp As New GraphicsPath()
  580.  
  581.         gp.AddLine(x + radius, y, x + width - (radius * 2), y)
  582.         ' Line
  583.         gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90)
  584.         ' Corner
  585.         gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2))
  586.         ' Line
  587.         gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, radius * 2, 0, 90)
  588.         ' Corner
  589.         gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height)
  590.         ' Line
  591.         gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90)
  592.         ' Corner
  593.         gp.AddLine(x, y + height - (radius * 2), x, y + radius)
  594.         ' Line
  595.         gp.AddArc(x, y, radius * 2, radius * 2, 180, 90)
  596.         ' Corner
  597.         gp.CloseFigure()
  598.  
  599.         g.DrawPath(p, gp)
  600.         gp.Dispose()
  601.     End Sub
  602.     Public Sub FillRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  603.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  604.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
  605.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  606.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  607.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  608.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  609.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  610.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  611.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  612.         g.SmoothingMode = mode
  613.     End Sub
  614.     Public Sub FillNotTopRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  615.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  616.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed
  617.         g.FillPie(b, r.X, r.Y, 1, 1, 180, 90)
  618.         g.FillPie(b, r.X + r.Width - d, r.Y, 1, 1, 270, 90)
  619.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  620.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  621.         ' g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  622.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  623.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  624.         g.SmoothingMode = mode
  625.     End Sub
  626.     Public Sub FillNotBottomRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  627.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  628.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
  629.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  630.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  631.         'g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  632.         '  g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  633.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  634.         ' g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  635.         '   g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  636.         g.SmoothingMode = mode
  637.     End Sub
  638. #End Region
  639.     Property Checked As Boolean = False
  640.     Event CheckedChanged()
  641.     Private Sub PlisticBlue_Checkbox_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  642.         e.Graphics.Clear(Back_color)
  643.         e.Graphics.SmoothingMode = SmoothingMode.AntiAlias
  644.         If Checked = False Then
  645.             DrawRoundRect(e.Graphics, New Pen(Border_color), 1, 1, 20, 20, 2)
  646.         Else
  647.             DrawRoundRect(e.Graphics, New Pen(Border_color), 1, 1, 20, 20, 2)
  648.             FillRoundedRectangle(e.Graphics, New Rectangle(0, 0, 21, 22), 2, New SolidBrush(Checked_color))
  649.             FixRoundRectClicked(e.Graphics, New Rectangle(0, 0, 21, 22))
  650.             e.Graphics.DrawString("a", New Font("Webdings", 16, FontStyle.Regular), New SolidBrush(Check_color), New Rectangle(2, 0, 20, 20), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  651.         End If
  652.         e.Graphics.DrawString(Text, Fonnt, New SolidBrush(Text_color), New Rectangle(24, 1, Me.Width - 23, Me.Height - 2), New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
  653.     End Sub
  654. #Region "Mouse"
  655.     Private Sub PlisticBlue_Checkbox_MouseDown(sender As Object, e As MouseEventArgs) Handles Me.MouseDown
  656.         If e.Button = Windows.Forms.MouseButtons.Left Then
  657.             If New Rectangle(1, 1, 20, 20).Contains(e.X, e.Y) Then
  658.                 Checked = Not Checked
  659.                 RaiseEvent CheckedChanged()
  660.                 Me.Refresh()
  661.             End If
  662.         End If
  663.     End Sub
  664.  
  665.     Private Sub PlisticBlue_Checkbox_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove
  666.         If New Rectangle(1, 1, 20, 20).Contains(e.X, e.Y) Then
  667.             Cursor = Cursors.Hand
  668.         Else
  669.             Cursor = Cursors.Arrow
  670.         End If
  671.     End Sub
  672. #End Region
  673. End Class
  674. Public Class PlisticBlue_TabSelector
  675.     Inherits Control
  676.     Property UnSelected_Circle_Color As Color = Color.FromArgb(52, 65, 94)
  677.     Property Selected_Circle_Color As Color = Color.FromArgb(166, 172, 192)
  678.     Property Selected_inCircle_Color As Color = Color.FromArgb(25, 38, 69)
  679.     Property unSelected_inCircle_Color As Color = Color.FromArgb(52, 65, 94)
  680.     Property Selected_line_Color As Color = Color.FromArgb(166, 172, 192)
  681.     Property UnSelected_line_Color As Color = Color.FromArgb(52, 65, 94)
  682.     Property back_Color As Color = Color.FromArgb(25, 38, 69)
  683.     Enum Selct
  684.         Step1
  685.         Step2
  686.         Step3
  687.     End Enum
  688.     Property Selected As Selct
  689.     Sub New()
  690.         Me.DoubleBuffered = True
  691.         Me.Width = 100
  692.         Me.Height = 20
  693.     End Sub
  694.  
  695.  
  696.     Private Sub PlisticBlue_TabSelector_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  697.         e.Graphics.Clear(back_Color)
  698.         e.Graphics.SmoothingMode = SmoothingMode.AntiAlias
  699.         Select Case Selected
  700.  
  701.             Case Selct.Step1
  702.                 e.Graphics.FillRectangle(New SolidBrush(UnSelected_line_Color), New Rectangle(4, Me.Height / 2 - 2, Me.Width / 2 - 9, 4))
  703.                 e.Graphics.FillEllipse(New SolidBrush(Selected_Circle_Color), New Rectangle(0, 0, 18, 18))
  704.                 e.Graphics.FillEllipse(New SolidBrush(Selected_inCircle_Color), New Rectangle(4, 4, 10, 10))
  705.                 e.Graphics.FillRectangle(New SolidBrush(UnSelected_line_Color), New Rectangle(Me.Width / 2 + 2, Me.Height / 2 - 2, Me.Width / 2 - 9, 4))
  706.                 e.Graphics.FillEllipse(New SolidBrush(UnSelected_Circle_Color), New Rectangle(Me.Width / 2 - 9, 0, 18, 18))
  707.                 e.Graphics.FillEllipse(New SolidBrush(unSelected_inCircle_Color), New Rectangle(Me.Width / 2 - 5, 4, 10, 10))
  708.                 e.Graphics.FillEllipse(New SolidBrush(UnSelected_Circle_Color), New Rectangle(Me.Width - 19, 0, 18, 18))
  709.                 e.Graphics.FillEllipse(New SolidBrush(unSelected_inCircle_Color), New Rectangle(Me.Width - 15, 4, 10, 10))
  710.             Case Selct.Step2
  711.                 e.Graphics.FillRectangle(New SolidBrush(Selected_line_Color), New Rectangle(4, Me.Height / 2 - 2, Me.Width / 2 - 9, 4))
  712.                 e.Graphics.FillEllipse(New SolidBrush(Selected_Circle_Color), New Rectangle(0, 0, 18, 18))
  713.                 e.Graphics.FillEllipse(New SolidBrush(Selected_inCircle_Color), New Rectangle(4, 4, 10, 10))
  714.                 e.Graphics.FillRectangle(New SolidBrush(UnSelected_line_Color), New Rectangle(Me.Width / 2 + 2, Me.Height / 2 - 2, Me.Width / 2 - 9, 4))
  715.                 e.Graphics.FillEllipse(New SolidBrush(Selected_Circle_Color), New Rectangle(Me.Width / 2 - 9, 0, 18, 18))
  716.                 e.Graphics.FillEllipse(New SolidBrush(Selected_inCircle_Color), New Rectangle(Me.Width / 2 - 5, 4, 10, 10))
  717.                 e.Graphics.FillEllipse(New SolidBrush(UnSelected_Circle_Color), New Rectangle(Me.Width - 19, 0, 18, 18))
  718.                 e.Graphics.FillEllipse(New SolidBrush(unSelected_inCircle_Color), New Rectangle(Me.Width - 15, 4, 10, 10))
  719.             Case Selct.Step3
  720.                 e.Graphics.FillRectangle(New SolidBrush(Selected_line_Color), New Rectangle(4, Me.Height / 2 - 2, Me.Width / 2 - 9, 4))
  721.                 e.Graphics.FillEllipse(New SolidBrush(Selected_Circle_Color), New Rectangle(0, 0, 18, 18))
  722.                 e.Graphics.FillEllipse(New SolidBrush(Selected_inCircle_Color), New Rectangle(4, 4, 10, 10))
  723.                 e.Graphics.FillRectangle(New SolidBrush(Selected_line_Color), New Rectangle(Me.Width / 2 + 2, Me.Height / 2 - 2, Me.Width / 2 - 9, 4))
  724.                 e.Graphics.FillEllipse(New SolidBrush(Selected_Circle_Color), New Rectangle(Me.Width / 2 - 9, 0, 18, 18))
  725.                 e.Graphics.FillEllipse(New SolidBrush(Selected_inCircle_Color), New Rectangle(Me.Width / 2 - 5, 4, 10, 10))
  726.                 e.Graphics.FillEllipse(New SolidBrush(Selected_Circle_Color), New Rectangle(Me.Width - 19, 0, 18, 18))
  727.                 e.Graphics.FillEllipse(New SolidBrush(Selected_inCircle_Color), New Rectangle(Me.Width - 15, 4, 10, 10))
  728.         End Select
  729.     End Sub
  730.     Event SelectedChange(Selectted As Selct)
  731.     Property Lock As Boolean = False
  732. #Region "Mouse"
  733.  
  734.     Private Sub PlisticBlue_TabSelector_MouseClick(sender As Object, e As MouseEventArgs) Handles Me.MouseClick
  735.         If e.Button = Windows.Forms.MouseButtons.Left Then
  736.             If Not Lock = True Then
  737.                     If New Rectangle(0, 0, 18, 18).Contains(e.X, e.Y) Then
  738.                         RaiseEvent SelectedChange(Selct.Step1)
  739.                         Selected = Selct.Step1
  740.                         Me.Refresh()
  741.                     End If
  742.                     If New Rectangle(Me.Width / 2 - 9, 0, 18, 18).Contains(e.X, e.Y) Then
  743.                         RaiseEvent SelectedChange(Selct.Step2)
  744.                         Selected = Selct.Step2
  745.                         Me.Refresh()
  746.                     End If
  747.                     If New Rectangle(Me.Width - 19, 0, 18, 18).Contains(e.X, e.Y) Then
  748.                         RaiseEvent SelectedChange(Selct.Step3)
  749.                         Selected = Selct.Step3
  750.                         Me.Refresh()
  751.                     End If
  752.             End If
  753.         End If
  754.     End Sub
  755.  
  756.     Private Sub PlisticBlue_TabSelector_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove
  757.         If New Rectangle(Me.Width - 19, 0, 18, 18).Contains(e.X, e.Y) Or New Rectangle(Me.Width / 2 - 9, 0, 18, 18).Contains(e.X, e.Y) Or New Rectangle(0, 0, 18, 18).Contains(e.X, e.Y) Then
  758.             Cursor = Cursors.Hand
  759.         Else
  760.             Cursor = Cursors.Arrow
  761.         End If
  762.     End Sub
  763. #End Region
  764. End Class
  765. Public Class PlisticBlue_Textbox
  766.     Inherits Control
  767.     Protected Overrides Sub OnCreateControl()
  768.         MyBase.OnCreateControl()
  769.         If Not Controls.Contains(TB) Then
  770.             Controls.Add(TB)
  771.         End If
  772.     End Sub
  773.     Sub New()
  774.         Me.DoubleBuffered = True
  775.         Me.Width = 150
  776.         Me.Height = 40
  777.         'TB
  778.         MyBase.Font = Text_Font
  779.         TB = New Windows.Forms.TextBox
  780.         TB.BackColor = Text_Back_Color
  781.         TB.Font = New Font("Segoe UI", 9)
  782.         TB.Text = Text
  783.         TB.BackColor = Textbox_Back_Color
  784.         TB.ForeColor = Text_Color
  785.         TB.MaxLength = MaxLeng
  786.         TB.Multiline = False
  787.         TB.ReadOnly = ReadOnlyy
  788.         TB.UseSystemPasswordChar = UseChar
  789.         TB.BorderStyle = BorderStyle.None
  790.         If Icon = True Then
  791.             TB.Location = New Point(40, Me.Height / 2 - TB.Height / 2)
  792.             TB.Size = New Size(Me.Width - 44, TB.Height)
  793.         Else
  794.             TB.Location = New Point(10, Me.Height / 2 - TB.Height / 2)
  795.             TB.Size = New Size(Me.Width - 14, TB.Height)
  796.         End If
  797.         TB.Font = MyBase.Font
  798.     End Sub
  799. #Region "Properties"
  800.     Public WithEvents TB As New TextBox
  801.     Property Icon As Boolean = False
  802.     Property Image As Image
  803.     Private Text_Color As Color = Color.FromArgb(166, 172, 192)
  804.     Private Text_Font As Font = New Font("Arial", 11, FontStyle.Regular)
  805.     Private back_Color As Color = Color.FromArgb(25, 38, 69)
  806.     Private Text_Back_Color As Color = Color.FromArgb(15, 23, 41)
  807.     Private UseChar As Boolean = False
  808.     Property Lock As Boolean = False
  809.     Private Textbox_Back_Color As Color = Color.FromArgb(15, 23, 41)
  810.     Private MaxLeng As Integer = 255
  811.     Private ReadOnlyy As Boolean = False
  812.     Private TextAlignn As HorizontalAlignment = HorizontalAlignment.Left
  813.     Private Multilinee As Boolean
  814.     Public Sub SelectAll()
  815.         TB.Focus()
  816.         TB.SelectAll()
  817.         Invalidate()
  818.     End Sub
  819.  
  820.     <Category("Textbox")>
  821.     Public Property BaseColour As Color
  822.         Get
  823.             Return Textbox_Back_Color
  824.         End Get
  825.         Set(value As Color)
  826.             Textbox_Back_Color = value
  827.         End Set
  828.     End Property
  829.  
  830.     <Category("Textbox")>
  831.     Public Property TextColour As Color
  832.         Get
  833.             Return Text_Color
  834.         End Get
  835.         Set(value As Color)
  836.             Text_Color = value
  837.         End Set
  838.     End Property
  839.  
  840.  
  841.  
  842.     <Category("Textbox")>
  843.     Property TextAlign() As HorizontalAlignment
  844.         Get
  845.             Return TextAlignn
  846.         End Get
  847.         Set(ByVal value As HorizontalAlignment)
  848.             TextAlignn = value
  849.             If TB IsNot Nothing Then
  850.                 TB.TextAlign = value
  851.             End If
  852.         End Set
  853.     End Property
  854.  
  855.     <Category("Textbox")>
  856.     Property MaxLength() As Integer
  857.         Get
  858.             Return MaxLeng
  859.         End Get
  860.         Set(ByVal value As Integer)
  861.             MaxLeng = value
  862.             If TB IsNot Nothing Then
  863.                 TB.MaxLength = value
  864.             End If
  865.         End Set
  866.     End Property
  867.  
  868.     <Category("Textbox")>
  869.     Property [ReadOnly]() As Boolean
  870.         Get
  871.             Return ReadOnlyy
  872.         End Get
  873.         Set(ByVal value As Boolean)
  874.             ReadOnlyy = value
  875.             If TB IsNot Nothing Then
  876.                 TB.ReadOnly = value
  877.             End If
  878.         End Set
  879.     End Property
  880.  
  881.     <Category("Textbox")>
  882.     Property UseSystemPasswordChar() As Boolean
  883.         Get
  884.             Return UseChar
  885.         End Get
  886.         Set(ByVal value As Boolean)
  887.             UseChar = value
  888.             If TB IsNot Nothing Then
  889.                 TB.UseSystemPasswordChar = value
  890.             End If
  891.         End Set
  892.     End Property
  893.     <Category("Textbox")>
  894.     Property Textt As String
  895.         Get
  896.             Return Text
  897.         End Get
  898.         Set(ByVal value As String)
  899.             Text = value
  900.             If TB IsNot Nothing Then
  901.                 TB.Text = value
  902.             End If
  903.         End Set
  904.     End Property
  905.  
  906. #End Region
  907. #Region "Functions"
  908.     Public Sub FixRoundRectClicked(g As Graphics)
  909.         'Fix Top
  910.         'Line right
  911.         g.DrawLine(New Pen(Textbox_Back_Color), New Point(Me.Width - 7, 2), New Point(Me.Width - 7, 7))
  912.         'Line left
  913.         g.DrawLine(New Pen(Textbox_Back_Color), New Point(7, 2), New Point(7, 7))
  914.         'Long Line
  915.         g.DrawLine(New Pen(Textbox_Back_Color), New Point(2, 7), New Point(Me.Width - 2, 7))
  916.         'Fix Bottom
  917.         'Line Bottom Right
  918.         ' g.DrawLine(New Pen(Under_Color), New Point(7, Me.Height - 2), New Point(7, Me.Height - 4))
  919.         'Line Bottom Left
  920.         ' g.DrawLine(New Pen(Under_Color), New Point(Me.Width - 7, Me.Height - 2), New Point(Me.Width - 7, Me.Height - 4))
  921.         'Line right
  922.         g.DrawLine(New Pen(Textbox_Back_Color), New Point(Me.Width - 7, Me.Height - 2), New Point(Me.Width - 7, Me.Height - 6))
  923.         'Line left
  924.         g.DrawLine(New Pen(Textbox_Back_Color), New Point(7, Me.Height - 2), New Point(7, Me.Height - 6))
  925.         'Long Line
  926.         g.DrawLine(New Pen(Textbox_Back_Color), New Point(2, Me.Height - 7), New Point(Me.Width - 2, Me.Height - 7))
  927.     End Sub
  928.     Public Sub FixRoundRect(g As Graphics)
  929.         'Fix Top
  930.         'Line right
  931.         g.DrawLine(New Pen(Textbox_Back_Color), New Point(Me.Width - 7, 2), New Point(Me.Width - 7, 7))
  932.         'Line left
  933.         g.DrawLine(New Pen(Textbox_Back_Color), New Point(7, 2), New Point(7, 7))
  934.         'Long Line
  935.         g.DrawLine(New Pen(Textbox_Back_Color), New Point(2, 7), New Point(Me.Width - 2, 7))
  936.         'Fix Bottom
  937.         'Line Bottom Right
  938.         ' g.DrawLine(New Pen(Under_Color), New Point(7, Me.Height - 2), New Point(7, Me.Height - 4))
  939.         'Line Bottom Left
  940.         'g.DrawLine(New Pen(Under_Color), New Point(Me.Width - 7, Me.Height - 2), New Point(Me.Width - 7, Me.Height - 4))
  941.         'Line right
  942.         g.DrawLine(New Pen(Textbox_Back_Color), New Point(Me.Width - 7, Me.Height - 6), New Point(Me.Width - 7, Me.Height - 11))
  943.         'Line left
  944.         g.DrawLine(New Pen(Textbox_Back_Color), New Point(7, Me.Height - 6), New Point(7, Me.Height - 11))
  945.         'Long Line
  946.         g.DrawLine(New Pen(Textbox_Back_Color), New Point(2, Me.Height - 11), New Point(Me.Width - 2, Me.Height - 11))
  947.     End Sub
  948.     Public Sub DrawRoundRect(g As Graphics, p As Pen, x As Single, y As Single, width As Single, height As Single, _
  949.       radius As Single)
  950.         Dim gp As New GraphicsPath()
  951.  
  952.         gp.AddLine(x + radius, y, x + width - (radius * 2), y)
  953.         ' Line
  954.         gp.AddArc(x + width - (radius * 2), y, radius * 2, radius * 2, 270, 90)
  955.         ' Corner
  956.         gp.AddLine(x + width, y + radius, x + width, y + height - (radius * 2))
  957.         ' Line
  958.         gp.AddArc(x + width - (radius * 2), y + height - (radius * 2), radius * 2, radius * 2, 0, 90)
  959.         ' Corner
  960.         gp.AddLine(x + width - (radius * 2), y + height, x + radius, y + height)
  961.         ' Line
  962.         gp.AddArc(x, y + height - (radius * 2), radius * 2, radius * 2, 90, 90)
  963.         ' Corner
  964.         gp.AddLine(x, y + height - (radius * 2), x, y + radius)
  965.         ' Line
  966.         gp.AddArc(x, y, radius * 2, radius * 2, 180, 90)
  967.         ' Corner
  968.         gp.CloseFigure()
  969.  
  970.         g.DrawPath(p, gp)
  971.         gp.Dispose()
  972.     End Sub
  973.     Public Sub FillRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  974.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  975.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
  976.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  977.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  978.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  979.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  980.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  981.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  982.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  983.         g.SmoothingMode = mode
  984.     End Sub
  985.     Public Sub FillNotTopRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  986.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  987.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed
  988.         g.FillPie(b, r.X, r.Y, 1, 1, 180, 90)
  989.         g.FillPie(b, r.X + r.Width - d, r.Y, 1, 1, 270, 90)
  990.         g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  991.         g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  992.         ' g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  993.         g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  994.         g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  995.         g.SmoothingMode = mode
  996.     End Sub
  997.     Public Sub FillNotBottomRoundedRectangle(ByVal g As Drawing.Graphics, ByVal r As Rectangle, ByVal d As Integer, ByVal b As Brush)
  998.         Dim mode As Drawing2D.SmoothingMode = g.SmoothingMode
  999.         g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
  1000.         g.FillPie(b, r.X, r.Y, d, d, 180, 90)
  1001.         g.FillPie(b, r.X + r.Width - d, r.Y, d, d, 270, 90)
  1002.         'g.FillPie(b, r.X, r.Y + r.Height - d, d, d, 90, 90)
  1003.         '  g.FillPie(b, r.X + r.Width - d, r.Y + r.Height - d, d, d, 0, 90)
  1004.         g.FillRectangle(b, CInt(r.X + d / 2), r.Y, r.Width - d, CInt(d / 2))
  1005.         ' g.FillRectangle(b, r.X, CInt(r.Y + d / 2), r.Width, CInt(r.Height - d))
  1006.         '   g.FillRectangle(b, CInt(r.X + d / 2), CInt(r.Y + r.Height - d / 2), CInt(r.Width - d), CInt(d / 2))
  1007.         g.SmoothingMode = mode
  1008.     End Sub
  1009. #End Region
  1010.  
  1011.     Private Sub PlisticBlue_Textbox_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
  1012.         e.Graphics.Clear(back_Color)
  1013.         FillRoundedRectangle(e.Graphics, New Rectangle(1, 1, Me.Width - 2, Me.Height - 2), 12, New SolidBrush(Textbox_Back_Color))
  1014.         FixRoundRectClicked(e.Graphics)
  1015.         TB.BackColor = Textbox_Back_Color
  1016.         TB.ForeColor = Text_Color
  1017.         If Icon = True Then
  1018.             e.Graphics.DrawImage(Image, New Rectangle(6, 6, 32, 32))
  1019.         End If
  1020.         If Lock = True Then
  1021.             TB.ReadOnly = True
  1022.             ReadOnlyy = True
  1023.             TB.Refresh()
  1024.             '  FixRoundRectClicked(e.Graphics)
  1025.         Else
  1026.             TB.ReadOnly = False
  1027.             ReadOnlyy = False
  1028.             TB.Refresh()
  1029.         End If
  1030.     End Sub
  1031.  
  1032.     Private Sub PlisticBlue_Textbox_Resize(sender As Object, e As EventArgs) Handles Me.Resize
  1033.         If Icon = True Then
  1034.             TB.Location = New Point(40, Me.Height / 2 - TB.Height / 2)
  1035.             TB.Size = New Size(Me.Width - 44, TB.Height)
  1036.         Else
  1037.             TB.Location = New Point(10, Me.Height / 2 - TB.Height / 2)
  1038.             TB.Size = New Size(Me.Width - 14, TB.Height)
  1039.         End If
  1040.     End Sub
  1041.     Event TextChangedd(text As String)
  1042.     Private Sub TB_TextChanged(sender As Object, e As EventArgs) Handles TB.TextChanged
  1043.         Text = TB.Text
  1044.         Textt = TB.Text
  1045.         RaiseEvent TextChangedd(Text)
  1046.     End Sub
  1047. End Class
Add Comment
Please, Sign In to add comment