Advertisement
Guest User

Reactor Theme VB.Net

a guest
Jan 24th, 2012
16,721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System, System.Collections.Generic, System.Runtime.InteropServices, System.ComponentModel
  2. Imports System.Drawing, System.Drawing.Drawing2D, System.Drawing.Imaging, System.Windows.Forms
  3.  
  4. Enum MouseState As Byte
  5.     None = 0
  6.     Over = 1
  7.     Down = 2
  8.     Block = 3
  9. End Enum
  10.  
  11.  
  12. '--------------------- [ Theme ] --------------------
  13. 'Creator: oVERT3Xo
  14. 'Site: **********.net
  15. 'Created: 11/22/2011
  16. 'Changed: 11/23/2011
  17. '-------------------- [ /Theme ] ---------------------
  18. Public Class ReactorTheme : Inherits ContainerControl
  19.  
  20.     Dim WithEvents CloseBtn As New ReactorTopButton With {.Location = New Point(412, 7), .ButtonType = ReactorTopButton.topButtonType.Close, .CloseButtonFunction = ReactorTopButton.closeFunc.CloseForm}
  21.     Dim WithEvents MinimBtn As New ReactorTopButton With {.Location = New Point(393, 7), .ButtonType = ReactorTopButton.topButtonType.Minimize}
  22.  
  23. #Region " Control Help - Movement & Flicker Control "
  24.     Private MouseP As Point = New Point(0, 0)
  25.     Private Cap As Boolean = False
  26.     Private MoveHeight As Integer
  27.     Protected Overrides Sub OnPaintBackground(ByVal e As System.Windows.Forms.PaintEventArgs)
  28.     End Sub
  29.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  30.         MyBase.OnMouseDown(e)
  31.         If e.Button = Windows.Forms.MouseButtons.Left And New Rectangle(0, 0, Width, MoveHeight).Contains(e.Location) Then
  32.             Cap = True : MouseP = e.Location
  33.         End If
  34.     End Sub
  35.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  36.         MyBase.OnMouseUp(e) : Cap = False
  37.     End Sub
  38.     Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)
  39.         MyBase.OnMouseMove(e)
  40.         If Cap Then
  41.             Parent.Location = MousePosition - MouseP
  42.         End If
  43.     End Sub
  44.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  45.         MyBase.OnTextChanged(e)
  46.         Invalidate()
  47.     End Sub
  48.  
  49. #End Region
  50.  
  51.     Sub New()
  52.         MyBase.New()
  53.         Dock = DockStyle.Fill
  54.         MoveHeight = 45
  55.         Font = New Font("Verdana", 6.75F)
  56.         DoubleBuffered = True
  57.  
  58.         Controls.Add(CloseBtn)
  59.         Controls.Add(MinimBtn)
  60.     End Sub
  61.  
  62.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  63.         Dim G As Graphics = e.Graphics
  64.         MyBase.OnPaint(e)
  65.         If Not Me.ParentForm.FormBorderStyle = FormBorderStyle.None Then
  66.             Me.ParentForm.FormBorderStyle = FormBorderStyle.None
  67.         End If
  68.  
  69.         CloseBtn.Location = New Point(Width - 23, 7)
  70.         MinimBtn.Location = New Point(Width - 42, 7)
  71.  
  72.         Dim glossLGB As New LinearGradientBrush(New Rectangle(0, 0, Width, 15), Color.FromArgb(102, 97, 93), Color.FromArgb(55, 54, 52), 90S)
  73.         Dim glossLGB2 As New LinearGradientBrush(New Rectangle(0, 15, Width, 15), Color.Black, Color.FromArgb(26, 25, 21), 90S)
  74.         Dim shadowLGB As New LinearGradientBrush(New Rectangle(5, 31, Width - 11, 20), Color.FromArgb(23, 23, 22), Color.FromArgb(38, 38, 38), 90S)
  75.  
  76.         G.Clear(Color.FromArgb(26, 25, 21))
  77.         G.FillRectangle(glossLGB, New Rectangle(0, 0, Width, 15))
  78.         G.FillRectangle(glossLGB2, New Rectangle(0, 15, Width, 15))
  79.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(42, 41, 37))), 4, 30, Width - 9, Height - 36)
  80.         G.FillRectangle(New SolidBrush(Color.FromArgb(38, 38, 38)), New Rectangle(5, 31, Width - 11, Height - 38))
  81.         G.FillRectangle(shadowLGB, New Rectangle(5, 31, Width - 11, 20))
  82.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(24, 24, 24))), 5, 32, Width - 7, 32)
  83.         G.DrawRectangle(Pens.Black, New Rectangle(5, 31, Width - 11, Height - 38))
  84.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(151, 150, 146))), 1, 1, Width - 2, 1)
  85.  
  86.         G.DrawRectangle(Pens.Black, New Rectangle(0, 0, Width - 1, Height - 1))
  87.  
  88.         'G.DrawString(Text, Font, Brushes.Black, Width / 2 - (3 * Text.Length) + 3, 7)
  89.        'G.DrawString(Text, Font, Brushes.White, Width / 2 - (3 * Text.Length) + 3, 8)
  90.        G.DrawString(Text, Font, Brushes.Black, New Rectangle(0, 10, Width - 1, 10), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  91.         G.DrawString(Text, Font, Brushes.White, New Rectangle(0, 11, Width - 1, 11), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  92.     End Sub
  93. End Class
  94.  
  95.  
  96. '--------------------- [ Button ] --------------------
  97. 'Creator: oVERT3Xo
  98. 'Site: **********.net
  99. 'Created: 11/22/2011
  100. 'Changed: 11/23/2011
  101. '-------------------- [ /Button ] ---------------------
  102. Public Class ReactorButton : Inherits Control
  103.  
  104. #Region " Control Help - MouseState & Flicker Control"
  105.     Private State As MouseState = MouseState.None
  106.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  107.         MyBase.OnMouseEnter(e)
  108.         State = MouseState.Over
  109.         Invalidate()
  110.     End Sub
  111.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  112.         MyBase.OnMouseDown(e)
  113.         State = MouseState.Down
  114.         Invalidate()
  115.     End Sub
  116.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  117.         MyBase.OnMouseLeave(e)
  118.         State = MouseState.None
  119.         Invalidate()
  120.     End Sub
  121.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  122.         MyBase.OnMouseUp(e)
  123.         State = MouseState.Over
  124.         Invalidate()
  125.     End Sub
  126.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  127.     End Sub
  128.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  129.         MyBase.OnTextChanged(e)
  130.         Invalidate()
  131.     End Sub
  132. #End Region
  133.  
  134.     Sub New()
  135.         MyBase.New()
  136.         BackColor = Color.FromArgb(38, 38, 38)
  137.         Font = New Font("Verdana", 6.75F)
  138.         DoubleBuffered = True
  139.     End Sub
  140.  
  141.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  142.         Dim G As Graphics = e.Graphics
  143.         MyBase.OnPaint(e)
  144.  
  145.         G.Clear(Color.FromArgb(36, 34, 30))
  146.  
  147.         Select Case State
  148.             Case MouseState.None 'Mouse None
  149.                G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(36, 34, 30))), 2, Height - 1, Width - 4, Height - 1)
  150.                 Dim backGrad As New LinearGradientBrush(New Rectangle(1, 1, Width - 1, Height - 2), Color.FromArgb(10, 9, 8), Color.FromArgb(31, 29, 26), 90S)
  151.                 G.FillRectangle(backGrad, New Rectangle(1, 1, Width - 1, Height - 2))
  152.                 G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(46, 45, 44))), New Rectangle(1, 1, Width - 3, Height - 4))
  153.             Case MouseState.Over 'Mouse Hover
  154.                G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(46, 44, 38))), 2, Height - 1, Width - 4, Height - 1)
  155.                 Dim backGrad As New LinearGradientBrush(New Rectangle(1, 1, Width - 1, Height - 2), Color.FromArgb(219, 78, 0), Color.FromArgb(230, 95, 0), 90S)
  156.                 G.FillRectangle(backGrad, New Rectangle(1, 1, Width - 1, Height - 2))
  157.                 G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(245, 120, 10))), New Rectangle(1, 1, Width - 3, Height - 4))
  158.             Case MouseState.Down 'Mouse Down
  159.                G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(36, 34, 30))), 2, Height - 1, Width - 4, Height - 1)
  160.                 Dim backGrad As New LinearGradientBrush(New Rectangle(1, 1, Width - 1, Height - 2), Color.FromArgb(209, 68, 0), Color.FromArgb(210, 75, 0), 270S)
  161.                 G.FillRectangle(backGrad, New Rectangle(1, 1, Width - 1, Height - 2))
  162.                 G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(225, 110, 30))), New Rectangle(1, 1, Width - 3, Height - 4))
  163.         End Select
  164.  
  165.         Dim glossGradient As New LinearGradientBrush(New Rectangle(1, 1, Width - 2, Height / 2 - 2), Color.FromArgb(80, Color.White), Color.FromArgb(50, Color.White), 90S)
  166.         G.FillRectangle(glossGradient, New Rectangle(1, 1, Width - 2, Height / 2 - 2))
  167.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(21, 20, 18))), New Rectangle(0, 0, Width - 1, Height - 2))
  168.  
  169.         G.DrawString(Text, Font, Brushes.Black, New Rectangle(0, -2, Width - 1, Height - 1), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  170.         G.DrawString(Text, Font, Brushes.White, New Rectangle(0, -1, Width - 1, Height - 1), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Center})
  171.     End Sub
  172. End Class
  173.  
  174.  
  175. '--------------------- [ TopButton ] --------------------
  176. 'Creator: oVERT3Xo
  177. 'Site: **********.net
  178. 'Created: 11/22/2011
  179. 'Changed: 11/23/2011
  180. '-------------------- [ /TopButton ] ---------------------
  181. Public Class ReactorTopButton : Inherits Control
  182.  
  183. #Region " Control Help - MouseState & Flicker Control"
  184.     Dim buttonColor As Color
  185.     Enum topButtonType As Byte
  186.         Blank = 0
  187.         Minimize = 1
  188.         Maximize = 2
  189.         Close = 3
  190.     End Enum
  191.     Private State As MouseState = MouseState.None
  192.     Private _tbType As topButtonType = topButtonType.Blank
  193.     Public Property ButtonType() As topButtonType
  194.         Get
  195.             Return _tbType
  196.         End Get
  197.         Set(ByVal v As topButtonType)
  198.             _tbType = v
  199.             Invalidate()
  200.         End Set
  201.     End Property
  202.     Private _defaultFunc As Boolean = True
  203.     Public Property UseStandardFunction() As Boolean
  204.         Get
  205.             Return _defaultFunc
  206.         End Get
  207.         Set(ByVal v As Boolean)
  208.             _defaultFunc = v
  209.         End Set
  210.     End Property
  211.  
  212.     Enum closeFunc As Byte
  213.         CloseForm = 0
  214.         CloseApp = 1
  215.     End Enum
  216.     Private _closeFunc As closeFunc = 0
  217.     Public Property CloseButtonFunction() As closeFunc
  218.         Get
  219.             Return _closeFunc
  220.         End Get
  221.         Set(ByVal v As closeFunc)
  222.             _closeFunc = v
  223.         End Set
  224.     End Property
  225.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  226.         MyBase.OnMouseEnter(e)
  227.         State = MouseState.Over
  228.         Invalidate()
  229.     End Sub
  230.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  231.         MyBase.OnMouseDown(e)
  232.         State = MouseState.Down
  233.         Invalidate()
  234.     End Sub
  235.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  236.         MyBase.OnMouseLeave(e)
  237.         State = MouseState.None
  238.         Invalidate()
  239.     End Sub
  240.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  241.         MyBase.OnMouseUp(e)
  242.         State = MouseState.Over
  243.         Invalidate()
  244.     End Sub
  245.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  246.     End Sub
  247.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  248.         MyBase.OnTextChanged(e)
  249.         Invalidate()
  250.     End Sub
  251.     Sub buttonFunction() Handles Me.Click
  252.         Select Case _defaultFunc
  253.             Case True
  254.                 Select Case ButtonType
  255.                     Case topButtonType.Close
  256.                         Select Case CloseButtonFunction
  257.                             Case 0
  258.                                 Me.Parent.FindForm.Close()
  259.                             Case 1
  260.                                 Application.Exit()
  261.                                 End
  262.                         End Select
  263.                     Case topButtonType.Minimize
  264.                         Me.Parent.FindForm.WindowState = FormWindowState.Minimized
  265.                     Case topButtonType.Maximize
  266.                         Me.Parent.FindForm.WindowState = FormWindowState.Maximized
  267.                 End Select
  268.         End Select
  269.     End Sub
  270. #End Region
  271.  
  272.     Sub New()
  273.         MyBase.New()
  274.         BackColor = Color.FromArgb(38, 38, 38)
  275.         Font = New Font("Verdana", 6.75F)
  276.         Size = New Size(17, 17)
  277.         DoubleBuffered = True
  278.     End Sub
  279.  
  280.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  281.         Dim G As Graphics = e.Graphics
  282.         MyBase.OnPaint(e)
  283.  
  284.         Size = New Size(17, 17)
  285.         G.Clear(Color.FromArgb(36, 34, 30))
  286.  
  287.         Select Case State
  288.             Case MouseState.None 'Mouse None
  289.                G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(36, 34, 30))), 2, Height - 1, Width - 4, Height - 1)
  290.                 Dim backGrad As New LinearGradientBrush(New Rectangle(1, 1, Width - 1, Height - 2), Color.FromArgb(10, 9, 8), Color.FromArgb(31, 29, 26), 90S)
  291.                 G.FillRectangle(backGrad, New Rectangle(1, 1, Width - 1, Height - 2))
  292.                 G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(46, 45, 44))), New Rectangle(1, 1, Width - 3, Height - 4))
  293.                 buttonColor = Color.FromArgb(163, 163, 162)
  294.             Case MouseState.Over 'Mouse Hover
  295.                G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(46, 44, 38))), 2, Height - 1, Width - 4, Height - 1)
  296.                 Dim backGrad As New LinearGradientBrush(New Rectangle(1, 1, Width - 1, Height - 2), Color.FromArgb(219, 78, 0), Color.FromArgb(230, 95, 0), 90S)
  297.                 G.FillRectangle(backGrad, New Rectangle(1, 1, Width - 1, Height - 2))
  298.                 G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(245, 120, 10))), New Rectangle(1, 1, Width - 3, Height - 4))
  299.                 buttonColor = Color.FromArgb(255, 255, 255)
  300.             Case MouseState.Down 'Mouse Down
  301.                G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(36, 34, 30))), 2, Height - 1, Width - 4, Height - 1)
  302.                 Dim backGrad As New LinearGradientBrush(New Rectangle(1, 1, Width - 1, Height - 2), Color.FromArgb(10, 9, 8), Color.FromArgb(31, 29, 26), 270S)
  303.                 G.FillRectangle(backGrad, New Rectangle(1, 1, Width - 1, Height - 2))
  304.                 G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(46, 45, 44))), New Rectangle(1, 1, Width - 3, Height - 4))
  305.  
  306.         End Select
  307.  
  308.         Select Case ButtonType
  309.             Case topButtonType.Minimize
  310.                 G.FillRectangle(New SolidBrush(buttonColor), New Rectangle(4, 10, 9, 2))
  311.             Case topButtonType.Maximize
  312.                 G.DrawRectangle(New Pen(New SolidBrush(buttonColor)), New Rectangle(4, 4, 8, 7))
  313.                 G.DrawLine(New Pen(New SolidBrush(buttonColor)), 4, 5, Width - 6, 5)
  314.             Case topButtonType.Close
  315.                 G.DrawLine(New Pen(New SolidBrush(buttonColor), 2), 4, 4, 12, 11)
  316.                 G.DrawLine(New Pen(New SolidBrush(buttonColor), 2), 12, 4, 4, 11)
  317.                 G.DrawLine(New Pen(New SolidBrush(buttonColor)), 4, 4, 5, 5)
  318.                 G.DrawLine(New Pen(New SolidBrush(buttonColor)), 4, 11, 5, 10)
  319.         End Select
  320.  
  321.                 Dim glossGradient As New LinearGradientBrush(New Rectangle(1, 1, Width - 2, 7), Color.FromArgb(80, Color.White), Color.FromArgb(50, Color.White), 90S)
  322.                 G.FillRectangle(glossGradient, New Rectangle(1, 1, Width - 2, 7))
  323.                 G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(21, 20, 18))), New Rectangle(0, 0, Width - 1, Height - 2))
  324.     End Sub
  325. End Class
  326.  
  327.  
  328. '--------------------- [ ProgressBar ] --------------------
  329. 'Creator: oVERT3Xo
  330. 'Site: **********.net
  331. 'Created: 11/22/2011
  332. 'Changed: 11/23/2011
  333. '-------------------- [ /ProgressBar ] ---------------------
  334. Public Class ReactorProgressBar : Inherits Control
  335.  
  336. #Region " Control Help - Properties & Flicker Control "
  337.     Private OFS As Integer = 0
  338.     Private Speed As Integer = 50
  339.     Private _Maximum As Integer = 100
  340.     Public Property Maximum() As Integer
  341.         Get
  342.             Return _Maximum
  343.         End Get
  344.         Set(ByVal v As Integer)
  345.             Select Case v
  346.                 Case Is < _Value
  347.                     _Value = v
  348.             End Select
  349.             _Maximum = v
  350.             Invalidate()
  351.         End Set
  352.     End Property
  353.     Private _Value As Integer = 0
  354.     Public Property Value() As Integer
  355.         Get
  356.             Select Case _Value
  357.                 Case 0
  358.                     Return 1
  359.                 Case Else
  360.                     Return _Value
  361.             End Select
  362.         End Get
  363.         Set(ByVal v As Integer)
  364.             Select Case v
  365.                 Case Is > _Maximum
  366.                     v = _Maximum
  367.             End Select
  368.             _Value = v
  369.             Invalidate()
  370.         End Set
  371.     End Property
  372.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  373.     End Sub
  374.     Protected Overrides Sub CreateHandle()
  375.         MyBase.CreateHandle()
  376.         ' Dim tmr As New Timer With {.Interval = Speed}
  377.        ' AddHandler tmr.Tick, AddressOf Animate
  378.        ' tmr.Start()
  379.        Dim T As New Threading.Thread(AddressOf Animate)
  380.         T.IsBackground = True
  381.         T.Start()
  382.     End Sub
  383.     Sub Animate()
  384.         While True
  385.             If OFS <= Width Then : OFS += 1
  386.             Else : OFS = 0
  387.             End If
  388.             Invalidate()
  389.             Threading.Thread.Sleep(Speed)
  390.         End While
  391.     End Sub
  392. #End Region
  393.  
  394.     Sub New()
  395.         MyBase.New()
  396.         DoubleBuffered = True
  397.     End Sub
  398.  
  399.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  400.         Dim G As Graphics = e.Graphics
  401.         MyBase.OnPaint(e)
  402.  
  403.         Dim intValue As Integer = CInt(_Value / _Maximum * Width)
  404.         G.Clear(Color.FromArgb(38, 38, 38))
  405.  
  406.         Dim backGrad As New LinearGradientBrush(New Rectangle(1, 1, intValue - 1, Height - 2), Color.FromArgb(10, 9, 8), Color.FromArgb(31, 29, 26), 90S)
  407.         G.FillRectangle(backGrad, New Rectangle(1, 1, intValue - 1, Height - 2))
  408.         Dim hatch As New HatchBrush(HatchStyle.WideUpwardDiagonal, Color.FromArgb(175, 219, 78, 0), Color.FromArgb(175, 229, 98, 0))
  409.         G.RenderingOrigin = New Point(OFS, 0)
  410.         G.FillRectangle(hatch, New Rectangle(1, 1, intValue - 2, Height - 2))
  411.         Dim glossGradient As New LinearGradientBrush(New Rectangle(1, 1, intValue - 2, Height / 2 - 1), Color.FromArgb(80, Color.White), Color.FromArgb(50, Color.White), 90S)
  412.         G.FillRectangle(glossGradient, New Rectangle(1, 1, intValue - 2, Height / 2 - 1))
  413.  
  414.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(10, 10, 10))), New Rectangle(0, 0, Width - 1, Height - 1))
  415.         G.DrawRectangle((New Pen(New SolidBrush(Color.Black))), New Rectangle(1, 1, Width - 3, Height - 3))
  416.         G.DrawRectangle((New Pen(New SolidBrush(Color.FromArgb(70, 70, 70)))), New Rectangle(0, 0, Width - 1, Height - 1))
  417.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, Width, 0)
  418.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, 0, Height)
  419.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), Width - 1, 0, Width - 1, Height)
  420.  
  421.     End Sub
  422. End Class
  423.  
  424.  
  425. '--------------------- [ TextBox (Multi) ] --------------------
  426. 'Creator: oVERT3Xo
  427. 'Site: **********.net
  428. 'Created: 11/22/2011
  429. 'Changed: 11/23/2011
  430. '-------------------- [ /TextBox (Multi) ] ---------------------
  431. Public Class ReactorMultiLineTextBox : Inherits Control
  432.     Dim WithEvents txtbox As New TextBox
  433.  
  434. #Region " Control Help - Properties & Flicker Control "
  435.     Private _maxchars As Integer = 32767
  436.     Public Property MaxCharacters() As Integer
  437.         Get
  438.             Return _maxchars
  439.         End Get
  440.         Set(ByVal v As Integer)
  441.             _maxchars = v
  442.             Invalidate()
  443.         End Set
  444.     End Property
  445.     Private _align As HorizontalAlignment
  446.     Public Property TextAlign() As HorizontalAlignment
  447.         Get
  448.             Return _align
  449.         End Get
  450.         Set(ByVal v As HorizontalAlignment)
  451.             _align = v
  452.             Invalidate()
  453.         End Set
  454.     End Property
  455.  
  456.  
  457.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  458.     End Sub
  459.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  460.         MyBase.OnTextChanged(e)
  461.         Invalidate()
  462.     End Sub
  463.     Protected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)
  464.         MyBase.OnBackColorChanged(e)
  465.         txtbox.BackColor = BackColor
  466.         Invalidate()
  467.     End Sub
  468.     Protected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)
  469.         MyBase.OnForeColorChanged(e)
  470.         txtbox.ForeColor = ForeColor
  471.         Invalidate()
  472.     End Sub
  473.     Protected Overrides Sub OnSizeChanged(ByVal e As System.EventArgs)
  474.         MyBase.OnSizeChanged(e)
  475.         txtbox.Size = New Size(Width - 10, Height - 11)
  476.     End Sub
  477.     Protected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)
  478.         MyBase.OnFontChanged(e)
  479.         txtbox.Font = Font
  480.     End Sub
  481.     Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
  482.         MyBase.OnGotFocus(e)
  483.         txtbox.Focus()
  484.     End Sub
  485.     Sub TextChngTxtBox() Handles txtbox.TextChanged
  486.         Text = txtbox.Text
  487.     End Sub
  488.     Sub TextChng() Handles MyBase.TextChanged
  489.         txtbox.Text = Text
  490.     End Sub
  491.     Sub NewTextBox()
  492.         With txtbox
  493.             .Multiline = True
  494.             .BackColor = BackColor
  495.             .ForeColor = ForeColor
  496.             .Text = String.Empty
  497.             .TextAlign = HorizontalAlignment.Center
  498.             .BorderStyle = BorderStyle.None
  499.             .Location = New Point(2, 4)
  500.             .Font = New Font("Verdana", 7.25)
  501.             .Size = New Size(Width - 10, Height - 10)
  502.         End With
  503.     End Sub
  504. #End Region
  505.  
  506.     Sub New()
  507.         MyBase.New()
  508.  
  509.         NewTextBox()
  510.         Controls.Add(txtbox)
  511.  
  512.         Text = ""
  513.         BackColor = Color.FromArgb(37, 37, 37)
  514.         ForeColor = Color.White
  515.         Size = New Size(135, 35)
  516.         DoubleBuffered = True
  517.     End Sub
  518.  
  519.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  520.         Dim G As Graphics = e.Graphics
  521.         MyBase.OnPaint(e)
  522.  
  523.         txtbox.TextAlign = TextAlign
  524.  
  525.         G.FillRectangle(New SolidBrush(Color.FromArgb(37, 37, 37)), New Rectangle(1, 1, Width - 2, Height - 2))
  526.         G.DrawRectangle((New Pen(New SolidBrush(Color.Black))), New Rectangle(1, 1, Width - 3, Height - 3))
  527.         G.DrawRectangle((New Pen(New SolidBrush(Color.FromArgb(70, 70, 70)))), New Rectangle(0, 0, Width - 1, Height - 1))
  528.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, Width, 0)
  529.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, 0, Height)
  530.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), Width - 1, 0, Width - 1, Height)
  531.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(31, 31, 31))), 2, 2, Width - 3, 2)
  532.     End Sub
  533. End Class
  534.  
  535.  
  536. '--------------------- [ TextBox ] --------------------
  537. 'Creator: oVERT3Xo
  538. 'Site: **********.net
  539. 'Created: 11/22/2011
  540. 'Changed: 11/23/2011
  541. '-------------------- [ /TextBox ] ---------------------
  542. Public Class ReactorTextBox : Inherits Control
  543.     Dim WithEvents txtbox As New TextBox
  544.  
  545. #Region " Control Help - Properties & Flicker Control "
  546.     Private _passmask As Boolean = False
  547.     Public Property UsePasswordMask() As Boolean
  548.         Get
  549.             Return _PassMask
  550.         End Get
  551.         Set(ByVal v As Boolean)
  552.             _PassMask = v
  553.             Invalidate()
  554.         End Set
  555.     End Property
  556.     Private _maxchars As Integer = 32767
  557.     Public Property MaxCharacters() As Integer
  558.         Get
  559.             Return _maxchars
  560.         End Get
  561.         Set(ByVal v As Integer)
  562.             _maxchars = v
  563.             Invalidate()
  564.         End Set
  565.     End Property
  566.     Private _align As HorizontalAlignment
  567.     Public Property TextAlign() As HorizontalAlignment
  568.         Get
  569.             Return _align
  570.         End Get
  571.         Set(ByVal v As HorizontalAlignment)
  572.             _align = v
  573.             Invalidate()
  574.         End Set
  575.     End Property
  576.  
  577.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  578.     End Sub
  579.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  580.         MyBase.OnTextChanged(e)
  581.         Invalidate()
  582.     End Sub
  583.     Protected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)
  584.         MyBase.OnBackColorChanged(e)
  585.         txtbox.BackColor = BackColor
  586.         Invalidate()
  587.     End Sub
  588.     Protected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)
  589.         MyBase.OnForeColorChanged(e)
  590.         txtbox.ForeColor = ForeColor
  591.         Invalidate()
  592.     End Sub
  593.     Protected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)
  594.         MyBase.OnFontChanged(e)
  595.         txtbox.Font = Font
  596.     End Sub
  597.     Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
  598.         MyBase.OnGotFocus(e)
  599.         txtbox.Focus()
  600.     End Sub
  601.  
  602.     Sub TextChngTxtBox() Handles txtbox.TextChanged
  603.         Text = txtbox.Text
  604.     End Sub
  605.     Sub TextChng() Handles MyBase.TextChanged
  606.         txtbox.Text = Text
  607.     End Sub
  608.     Sub NewTextBox()
  609.         With txtbox
  610.             .Multiline = False
  611.             .BackColor = BackColor
  612.             .ForeColor = ForeColor
  613.             .Text = String.Empty
  614.             .TextAlign = HorizontalAlignment.Center
  615.             .BorderStyle = BorderStyle.None
  616.             .Location = New Point(5, 5)
  617.             .Font = New Font("Verdana", 7.25)
  618.             .Size = New Size(Width - 10, Height - 11)
  619.             .UseSystemPasswordChar = UsePasswordMask
  620.         End With
  621.  
  622.     End Sub
  623. #End Region
  624.  
  625.     Sub New()
  626.         MyBase.New()
  627.  
  628.         NewTextBox()
  629.         Controls.Add(txtbox)
  630.  
  631.         Text = ""
  632.         BackColor = Color.FromArgb(37, 37, 37)
  633.         ForeColor = Color.White
  634.         Size = New Size(135, 35)
  635.         DoubleBuffered = True
  636.     End Sub
  637.  
  638.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  639.         Dim G As Graphics = e.Graphics
  640.         MyBase.OnPaint(e)
  641.  
  642.         Height = txtbox.Height + 11
  643.         With txtbox
  644.             .Width = Width - 10
  645.             .TextAlign = TextAlign
  646.             .UseSystemPasswordChar = UsePasswordMask
  647.         End With
  648.  
  649.         G.Clear(BackColor)
  650.         G.FillRectangle(New SolidBrush(Color.FromArgb(37, 37, 37)), New Rectangle(1, 1, Width - 2, Height - 2))
  651.         G.DrawRectangle((New Pen(New SolidBrush(Color.Black))), New Rectangle(1, 1, Width - 3, Height - 3))
  652.         G.DrawRectangle((New Pen(New SolidBrush(Color.FromArgb(70, 70, 70)))), New Rectangle(0, 0, Width - 1, Height - 1))
  653.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, Width, 0)
  654.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, 0, Height)
  655.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), Width - 1, 0, Width - 1, Height)
  656.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(31, 31, 31))), 2, 2, Width - 3, 2)
  657.     End Sub
  658. End Class
  659.  
  660.  
  661. '--------------------- [ ListBox ] --------------------
  662. 'Creator: oVERT3Xo
  663. 'Site: **********.net
  664. 'Created: 11/22/2011
  665. 'Changed: 11/23/2011
  666. '-------------------- [ /ListBox ] ---------------------
  667. Public Class ReactorListBox : Inherits Control
  668.     Public WithEvents lstbox As New ListBox
  669.     Private __Items As String() = {""}
  670.  
  671. #Region " Control Help - Properties & Flicker Control "
  672.  
  673.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  674.     End Sub
  675.     Protected Overrides Sub OnSizeChanged(ByVal e As System.EventArgs)
  676.         MyBase.OnSizeChanged(e)
  677.         lstbox.Size = New Size(Width - 6, Height - 6)
  678.         Invalidate()
  679.     End Sub
  680.     Protected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)
  681.         MyBase.OnBackColorChanged(e)
  682.         lstbox.BackColor = BackColor
  683.         Invalidate()
  684.     End Sub
  685.     Protected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)
  686.         MyBase.OnForeColorChanged(e)
  687.         lstbox.ForeColor = ForeColor
  688.         Invalidate()
  689.     End Sub
  690.     Protected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)
  691.         MyBase.OnFontChanged(e)
  692.         lstbox.Font = Font
  693.     End Sub
  694.     Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
  695.         MyBase.OnGotFocus(e)
  696.         lstbox.Focus()
  697.     End Sub
  698.  
  699.     Public Property Items As String()
  700.         Get
  701.             Return __Items
  702.             Invalidate()
  703.         End Get
  704.         Set(ByVal value As String())
  705.             __Items = value
  706.             lstbox.Items.Clear()
  707.             Invalidate()
  708.             lstbox.Items.AddRange(value)
  709.             Invalidate()
  710.         End Set
  711.     End Property
  712.     Public ReadOnly Property SelectedItem() As String
  713.         Get
  714.             Return lstbox.SelectedItem
  715.         End Get
  716.     End Property
  717.     Sub DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles lstbox.DrawItem
  718.         Try
  719.             e.DrawBackground()
  720.             e.Graphics.DrawString(lstbox.Items(e.Index).ToString(), _
  721.             e.Font, New SolidBrush(lstbox.ForeColor), e.Bounds, StringFormat.GenericDefault)
  722.             e.DrawFocusRectangle()
  723.         Catch
  724.         End Try
  725.     End Sub
  726.     Sub AddRange(ByVal Items As Object())
  727.         lstbox.Items.Remove("")
  728.         lstbox.Items.AddRange(Items)
  729.         Invalidate()
  730.     End Sub
  731.     Sub AddItem(ByVal Item As Object)
  732.         lstbox.Items.Add(Item)
  733.         Invalidate()
  734.     End Sub
  735.     Sub NewListBox()
  736.         lstbox.Size = New Size(126, 96)
  737.         lstbox.BorderStyle = BorderStyle.None
  738.         lstbox.DrawMode = DrawMode.OwnerDrawVariable
  739.         lstbox.Location = New Point(4, 4)
  740.         lstbox.ForeColor = Color.FromArgb(216, 216, 216)
  741.         lstbox.BackColor = Color.FromArgb(38, 38, 38)
  742.         lstbox.Items.Clear()
  743.     End Sub
  744.  
  745. #End Region
  746.  
  747.     Sub New()
  748.         MyBase.New()
  749.  
  750.         NewListBox()
  751.         Controls.Add(lstbox)
  752.  
  753.         Size = New Size(131, 101)
  754.         BackColor = Color.FromArgb(38, 38, 38)
  755.         DoubleBuffered = True
  756.     End Sub
  757.  
  758.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  759.         Dim G As Graphics = e.Graphics
  760.         MyBase.OnPaint(e)
  761.  
  762.         G.Clear(BackColor)
  763.         G.FillRectangle(New SolidBrush(Color.FromArgb(37, 37, 37)), New Rectangle(1, 1, Width - 2, Height - 2))
  764.         G.DrawRectangle((New Pen(New SolidBrush(Color.Black))), New Rectangle(1, 1, Width - 3, Height - 3))
  765.         G.DrawRectangle((New Pen(New SolidBrush(Color.FromArgb(70, 70, 70)))), New Rectangle(0, 0, Width - 1, Height - 1))
  766.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, Width, 0)
  767.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, 0, Height)
  768.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), Width - 1, 0, Width - 1, Height)
  769.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(31, 31, 31))), 2, 2, Width - 3, 2)
  770.     End Sub
  771. End Class
  772.  
  773.  
  774. '--------------------- [ ComboBox ] --------------------
  775. 'Creator: oVERT3Xo
  776. 'Site: **********.net
  777. 'Created: 11/22/2011
  778. 'Changed: 11/23/2011
  779. '-------------------- [ /ComboBox ] ---------------------
  780. Public Class ReactorComboBox : Inherits ComboBox
  781.  
  782. #Region " Control Help - Properties & Flicker Control "
  783.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  784.     End Sub
  785.     Private _StartIndex As Integer = 0
  786.     Public Property StartIndex As Integer
  787.         Get
  788.             Return _StartIndex
  789.         End Get
  790.         Set(ByVal value As Integer)
  791.             _StartIndex = value
  792.             Try
  793.                 MyBase.SelectedIndex = value
  794.             Catch
  795.             End Try
  796.             Invalidate()
  797.         End Set
  798.     End Property
  799.     Private LightBlack As Color = Color.FromArgb(37, 37, 37)
  800.     Private LighterBlack As Color = Color.FromArgb(60, 60, 60)
  801.     Sub ReplaceItem(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles Me.DrawItem
  802.         e.DrawBackground()
  803.         Try
  804.             If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then
  805.                 e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(229, 88, 0)), e.Bounds) '37 37 37
  806.            End If
  807.             Using b As New SolidBrush(e.ForeColor)
  808.                 e.Graphics.DrawString(MyBase.GetItemText(MyBase.Items(e.Index)), e.Font, b, e.Bounds)
  809.             End Using
  810.         Catch
  811.         End Try
  812.         e.DrawFocusRectangle()
  813.     End Sub
  814.     Protected Sub DrawTriangle(ByVal Clr As Color, ByVal FirstPoint As Point, ByVal SecondPoint As Point, ByVal ThirdPoint As Point, ByVal G As Graphics)
  815.         Dim points As New List(Of Point)()
  816.         points.Add(FirstPoint)
  817.         points.Add(SecondPoint)
  818.         points.Add(ThirdPoint)
  819.         G.FillPolygon(New SolidBrush(Clr), points.ToArray)
  820.     End Sub
  821. #End Region
  822.  
  823.     Sub New()
  824.         MyBase.New()
  825.         SetStyle(ControlStyles.AllPaintingInWmPaint Or _
  826.         ControlStyles.ResizeRedraw Or _
  827.         ControlStyles.UserPaint Or _
  828.         ControlStyles.DoubleBuffer, True)
  829.         DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
  830.         BackColor = Color.FromArgb(45, 45, 45)
  831.         ForeColor = Color.White
  832.         DropDownStyle = ComboBoxStyle.DropDownList
  833.         DoubleBuffered = True
  834.         Invalidate()
  835.     End Sub
  836.  
  837.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  838.         MyBase.OnPaint(e)
  839.         Dim G As Graphics = e.Graphics
  840.         Dim T As LinearGradientBrush = New LinearGradientBrush(New Rectangle(0, 0, Width, 10), Color.FromArgb(62, Color.White), Color.FromArgb(30, Color.White), 90S)
  841.         Dim DrawCornersBrush As SolidBrush
  842.         DrawCornersBrush = New SolidBrush(Color.FromArgb(37, 37, 37))
  843.         Try
  844.             With G
  845.                 .SmoothingMode = SmoothingMode.HighQuality
  846.                 .Clear(Color.FromArgb(37, 37, 37))
  847.                 .FillRectangle(T, New Rectangle(Width - 20, 0, Width, 9))
  848.                 .DrawLine(Pens.Black, Width - 20, 0, Width - 20, Height)
  849.                 Try
  850.                     '.DrawString(Items(SelectedIndex).ToString, Font, Brushes.White, New Rectangle(New Point(3, 3), New Size(Width - 18, Height)))
  851.                    .DrawString(Text, Font, Brushes.White, New Rectangle(3, 0, Width - 20, Height), New StringFormat With {.LineAlignment = StringAlignment.Center, .Alignment = StringAlignment.Near})
  852.                 Catch
  853.                 End Try
  854.  
  855.                 .DrawLine(New Pen(New SolidBrush(Color.FromArgb(37, 37, 37))), 0, 0, 0, 0)
  856.                 .DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(0, 0, 0))), New Rectangle(1, 1, Width - 3, Height - 3))
  857.  
  858.                 .DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, Width, 0)
  859.                 .DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, 0, Height)
  860.                 .DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), Width - 1, 0, Width - 1, Height)
  861.                 .DrawLine(New Pen(New SolidBrush(Color.FromArgb(70, 70, 70))), 0, Height - 1, Width, Height - 1)
  862.  
  863.                 DrawTriangle(Color.White, New Point(Width - 14, 8), New Point(Width - 7, 8), New Point(Width - 11, 11), G)
  864.             End With
  865.         Catch
  866.         End Try
  867.     End Sub
  868. End Class
  869.  
  870.  
  871. '--------------------- [ TabControl ] --------------------
  872. 'Creator: oVERT3Xo
  873. 'Site: **********.net
  874. 'Created: 11/22/2011
  875. 'Changed: 11/23/2011
  876. '-------------------- [ /TabControl ] ---------------------
  877. Public Class ReactorTabControl : Inherits TabControl
  878.  
  879. #Region " Control Help - Properties & Flicker Control "
  880.     Private DrawGradientBrush, DrawGradientBrush2 As LinearGradientBrush
  881.     Private _TabBrColor As Color
  882.     Public Property TabBorderColor() As Color
  883.         Get
  884.             Return _TabBrColor
  885.         End Get
  886.         Set(ByVal v As Color)
  887.             _TabBrColor = v
  888.             Invalidate()
  889.         End Set
  890.     End Property
  891.     Private _ControlBColor As Color
  892.     Public Property TabTextColor() As Color
  893.         Get
  894.             Return _ControlBColor
  895.         End Get
  896.         Set(ByVal v As Color)
  897.             _ControlBColor = v
  898.             Invalidate()
  899.         End Set
  900.     End Property
  901.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  902.     End Sub
  903. #End Region
  904.  
  905.     Sub New()
  906.         MyBase.New()
  907.         SetStyle(ControlStyles.AllPaintingInWmPaint Or _
  908.         ControlStyles.ResizeRedraw Or _
  909.         ControlStyles.UserPaint Or _
  910.         ControlStyles.DoubleBuffer, True)
  911.  
  912.         TabBorderColor = Color.White
  913.         TabTextColor = Color.White
  914.  
  915.     End Sub
  916.  
  917.     Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  918.         Dim G As Graphics = e.Graphics
  919.         MyBase.OnPaint(e)
  920.  
  921.         Dim r2 As New Rectangle(0, 0, Width - 1, 25)
  922.         Dim r3 As New Rectangle(0, 0, Width - 1, 25)
  923.         Dim r4 As New Rectangle(2, 0, Width - 1, 13)
  924.         Dim ItemBounds As Rectangle
  925.         Dim TextBrush As New SolidBrush(Color.Empty)
  926.         Dim TabBrush As New SolidBrush(Color.DimGray)
  927.         Dim dgb2 As New LinearGradientBrush(r4, Color.FromArgb(50, Color.White), Color.FromArgb(25, Color.White), 90S)
  928.  
  929.         G.Clear(Color.FromArgb(32, 32, 32))
  930.         DrawGradientBrush2 = New LinearGradientBrush(r3, Color.FromArgb(10, 10, 10), Color.FromArgb(50, 50, 50), 90S)
  931.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(28, 28, 28))), New Rectangle(1, 1, Width - 3, Height - 3))
  932.  
  933.         G.FillRectangle(DrawGradientBrush2, r2)
  934.         G.FillRectangle(dgb2, r4)
  935.  
  936.         For TabItemIndex As Integer = 0 To Me.TabCount - 1
  937.             ItemBounds = Me.GetTabRect(TabItemIndex)
  938.  
  939.             If CBool(TabItemIndex And 1) Then
  940.                 TabBrush.Color = Color.Transparent
  941.             Else
  942.                 TabBrush.Color = Color.Transparent
  943.             End If
  944.             G.FillRectangle(TabBrush, ItemBounds)
  945.             Dim BorderPen As Pen
  946.             If TabItemIndex = SelectedIndex Then
  947.                 BorderPen = New Pen(Color.Transparent, 1)
  948.                 Dim dgb As New LinearGradientBrush(New Rectangle(ItemBounds.Location.X + 3, ItemBounds.Location.Y + 3, ItemBounds.Width - 8, ItemBounds.Height - 6), Color.FromArgb(175, 219, 78, 0), Color.FromArgb(175, 229, 98, 0), 90S)
  949.                 Dim gloss As New LinearGradientBrush(New Rectangle(ItemBounds.Location.X + 3, ItemBounds.Location.Y + 3, ItemBounds.Width - 8, ItemBounds.Height / 2 - 5), Color.FromArgb(80, Color.White), Color.FromArgb(20, Color.White), 90S)
  950.                 G.FillRectangle(dgb, New Rectangle(ItemBounds.Location.X + 3, ItemBounds.Location.Y + 3, ItemBounds.Width - 8, ItemBounds.Height - 6))
  951.                 G.FillRectangle(gloss, New Rectangle(ItemBounds.Location.X + 3, ItemBounds.Location.Y + 3, ItemBounds.Width - 8, ItemBounds.Height / 2 - 4))
  952.                 G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(10, 10, 10))), New Rectangle(ItemBounds.Location.X + 3, ItemBounds.Location.Y + 3, ItemBounds.Width - 8, ItemBounds.Height - 6))
  953.                 G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(100, 230, 90, 0))), New Rectangle(ItemBounds.Location.X + 4, ItemBounds.Location.Y + 4, ItemBounds.Width - 10, ItemBounds.Height - 8))
  954.                 Dim r1 As New Rectangle(1, 1, Width - 1, 3)
  955.             Else
  956.                 BorderPen = New Pen(Color.Transparent, 1)
  957.             End If
  958.  
  959.             G.DrawRectangle(BorderPen, New Rectangle(ItemBounds.Location.X + 3, ItemBounds.Location.Y + 1, ItemBounds.Width - 8, ItemBounds.Height - 4))
  960.  
  961.             BorderPen.Dispose()
  962.  
  963.             Dim sf As New StringFormat
  964.             sf.LineAlignment = StringAlignment.Center
  965.             sf.Alignment = StringAlignment.Center
  966.  
  967.             If Me.SelectedIndex = TabItemIndex Then
  968.                 TextBrush.Color = TabTextColor
  969.             Else
  970.                 TextBrush.Color = Color.DimGray
  971.             End If
  972.             G.DrawString( _
  973.             Me.TabPages(TabItemIndex).Text, _
  974.             Me.Font, TextBrush, _
  975.             RectangleF.op_Implicit(Me.GetTabRect(TabItemIndex)), sf)
  976.             Try
  977.                 Me.TabPages(TabItemIndex).BackColor = Color.FromArgb(32, 32, 32)
  978.             Catch
  979.             End Try
  980.         Next
  981.         Try
  982.             For Each tabpg As TabPage In Me.TabPages
  983.                 tabpg.BorderStyle = BorderStyle.None
  984.             Next
  985.         Catch
  986.         End Try
  987.  
  988.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(10, 10, 10))), 2, 24, Width - 2, 24)
  989.         G.DrawRectangle((New Pen(New SolidBrush(Color.Black))), New Rectangle(1, 1, Width - 3, Height - 3))
  990.         G.DrawRectangle((New Pen(New SolidBrush(Color.FromArgb(70, 70, 70)))), New Rectangle(0, 0, Width - 1, Height - 1))
  991.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, Width, 0)
  992.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, 0, Height)
  993.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), Width - 1, 0, Width - 1, Height)
  994.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(31, 31, 31))), 2, 2, Width - 3, 2)
  995.     End Sub
  996. End Class
  997.  
  998.  
  999. '--------------------- [ CheckBox ] --------------------
  1000. 'Creator: oVERT3Xo
  1001. 'Site: **********.net
  1002. 'Created: 11/22/2011
  1003. 'Changed: 11/23/2011
  1004. '-------------------- [ /CheckBox ] ---------------------
  1005. <DefaultEvent("CheckedChanged")> Public Class ReactorCheckBox : Inherits Control
  1006.  
  1007. #Region " Control Help - MouseState & Flicker Control"
  1008.     Private State As MouseState = MouseState.None
  1009.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  1010.         MyBase.OnMouseEnter(e)
  1011.         State = MouseState.Over
  1012.         Invalidate()
  1013.     End Sub
  1014.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  1015.         MyBase.OnMouseDown(e)
  1016.         State = MouseState.Down
  1017.         Invalidate()
  1018.     End Sub
  1019.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  1020.         MyBase.OnMouseLeave(e)
  1021.         State = MouseState.None
  1022.         Invalidate()
  1023.     End Sub
  1024.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  1025.         MyBase.OnMouseUp(e)
  1026.         State = MouseState.Over
  1027.         Invalidate()
  1028.     End Sub
  1029.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  1030.     End Sub
  1031.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  1032.         MyBase.OnTextChanged(e)
  1033.         Invalidate()
  1034.     End Sub
  1035.     Private _Checked As Boolean
  1036.     Property Checked() As Boolean
  1037.         Get
  1038.             Return _Checked
  1039.         End Get
  1040.         Set(ByVal value As Boolean)
  1041.             _Checked = value
  1042.             Invalidate()
  1043.         End Set
  1044.     End Property
  1045.  
  1046.     Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
  1047.         _Checked = Not _Checked
  1048.         RaiseEvent CheckedChanged(Me)
  1049.         MyBase.OnClick(e)
  1050.     End Sub
  1051.     Event CheckedChanged(ByVal sender As Object)
  1052. #End Region
  1053.  
  1054.     Sub New()
  1055.         MyBase.New()
  1056.         BackColor = Color.FromArgb(38, 38, 38)
  1057.         ForeColor = Color.White
  1058.     End Sub
  1059.  
  1060.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  1061.         MyBase.OnPaint(e)
  1062.         Dim G As Graphics = e.Graphics
  1063.  
  1064.         Height = 16
  1065.  
  1066.         G.Clear(BackColor)
  1067.  
  1068.         Dim bordColor As Color = Color.FromArgb(46, 45, 44)
  1069.         Dim backGrad As New LinearGradientBrush(New Rectangle(1, 1, 14, Height - 2), Color.FromArgb(10, 9, 8), Color.FromArgb(31, 29, 26), 90S)
  1070.         Dim glossGradient As New LinearGradientBrush(New Rectangle(1, 1, 13, Height / 2 - 2), Color.FromArgb(80, Color.White), Color.FromArgb(50, Color.White), 90S)
  1071.  
  1072.         If _Checked Then
  1073.             bordColor = Color.FromArgb(225, 110, 30)
  1074.             backGrad = New LinearGradientBrush(New Rectangle(1, 1, 14, Height - 2), Color.FromArgb(209, 68, 0), Color.FromArgb(210, 75, 0), 90S)
  1075.         Else
  1076.             bordColor = Color.FromArgb(46, 45, 44)
  1077.             backGrad = New LinearGradientBrush(New Rectangle(1, 1, 14, Height - 2), Color.FromArgb(24, 24, 24), Color.FromArgb(30, 30, 30), 90S)
  1078.         End If
  1079.  
  1080.         G.DrawString(Text, Font, New SolidBrush(ForeColor), New Point(18, Height / 2 + (Font.Height) - 18))
  1081.  
  1082.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(36, 34, 30))), 2, Height - 1, 14, Height - 1)
  1083.         G.FillRectangle(backGrad, New Rectangle(1, 1, 14, Height - 2))
  1084.         G.DrawRectangle(New Pen(New SolidBrush(bordColor)), New Rectangle(1, 1, 12, Height - 4))
  1085.         If _Checked Then : G.FillRectangle(glossGradient, New Rectangle(1, 1, 13, Height / 2 - 2))
  1086.         End If
  1087.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(10, 10, 10))), New Rectangle(0, 0, 14, Height - 2))
  1088.     End Sub
  1089.  
  1090. End Class
  1091.  
  1092.  
  1093. '--------------------- [ RadioButton ] --------------------
  1094. 'Creator: oVERT3Xo
  1095. 'Site: **********.net
  1096. 'Created: 11/22/2011
  1097. 'Changed: 11/23/2011
  1098. '-------------------- [ /RadioButton ] ---------------------
  1099. <DefaultEvent("CheckedChanged")> Public Class ReactorRadioButton : Inherits Control
  1100.  
  1101. #Region " Control Help - MouseState & Flicker Control"
  1102.     Private R1 As Rectangle
  1103.     Private G1 As LinearGradientBrush
  1104.  
  1105.     Private State As MouseState = MouseState.None
  1106.     Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
  1107.         MyBase.OnMouseEnter(e)
  1108.         State = MouseState.Over
  1109.         Invalidate()
  1110.     End Sub
  1111.     Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
  1112.         MyBase.OnMouseDown(e)
  1113.         State = MouseState.Down
  1114.         Invalidate()
  1115.     End Sub
  1116.     Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
  1117.         MyBase.OnMouseLeave(e)
  1118.         State = MouseState.None
  1119.         Invalidate()
  1120.     End Sub
  1121.     Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
  1122.         MyBase.OnMouseUp(e)
  1123.         State = MouseState.Over
  1124.         Invalidate()
  1125.     End Sub
  1126.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  1127.     End Sub
  1128.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  1129.         MyBase.OnTextChanged(e)
  1130.         Invalidate()
  1131.     End Sub
  1132.     Private _Checked As Boolean
  1133.     Property Checked() As Boolean
  1134.         Get
  1135.             Return _Checked
  1136.         End Get
  1137.         Set(ByVal value As Boolean)
  1138.             _Checked = value
  1139.             InvalidateControls()
  1140.             RaiseEvent CheckedChanged(Me)
  1141.             Invalidate()
  1142.         End Set
  1143.     End Property
  1144.     Protected Overrides Sub OnClick(ByVal e As EventArgs)
  1145.         If Not _Checked Then Checked = True
  1146.         MyBase.OnClick(e)
  1147.     End Sub
  1148.     Event CheckedChanged(ByVal sender As Object)
  1149.     Protected Overrides Sub OnCreateControl()
  1150.         MyBase.OnCreateControl()
  1151.         InvalidateControls()
  1152.     End Sub
  1153.     Private Sub InvalidateControls()
  1154.         If Not IsHandleCreated OrElse Not _Checked Then Return
  1155.  
  1156.         For Each C As Control In Parent.Controls
  1157.             If C IsNot Me AndAlso TypeOf C Is ReactorRadioButton Then
  1158.                 DirectCast(C, ReactorRadioButton).Checked = False
  1159.             End If
  1160.         Next
  1161.     End Sub
  1162. #End Region
  1163.  
  1164.     Sub New()
  1165.         MyBase.New()
  1166.         BackColor = Color.FromArgb(38, 38, 38)
  1167.         ForeColor = Color.White
  1168.     End Sub
  1169.  
  1170.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  1171.         MyBase.OnPaint(e)
  1172.         Dim G As Graphics = e.Graphics
  1173.  
  1174.         Height = 16
  1175.         G.Clear(BackColor)
  1176.         G.SmoothingMode = SmoothingMode.HighQuality
  1177.         R1 = New Rectangle(2, 0, 13, 13)
  1178.         If _Checked Then
  1179.             G1 = New LinearGradientBrush(R1, Color.FromArgb(220, 209, 68, 0), Color.FromArgb(220, 210, 75, 0), 90S)
  1180.         Else
  1181.             G1 = New LinearGradientBrush(R1, Color.FromArgb(24, 24, 24), Color.FromArgb(30, 30, 30), 90S)
  1182.         End If
  1183.         G.FillEllipse(G1, R1)
  1184.         If State = MouseState.Over Then
  1185.             R1 = New Rectangle(2, 0, 13, 13)
  1186.             G.FillEllipse(New SolidBrush(Color.FromArgb(5, Color.White)), R1)
  1187.         End If
  1188.         If _Checked Then
  1189.             R1 = New Rectangle(4, 1, 9, 6)
  1190.             G1 = New LinearGradientBrush(R1, Color.FromArgb(80, 255, 255, 255), Color.FromArgb(30, 255, 255, 255), 90S)
  1191.             G.FillEllipse(G1, R1)
  1192.             G.DrawEllipse(New Pen(New SolidBrush(Color.FromArgb(225, 110, 30))), 3, 1, 11, 11)
  1193.         End If
  1194.         G.DrawString(Text, Font, New SolidBrush(ForeColor), 18, 1)
  1195.         G.DrawEllipse(Pens.Black, 2, 0, 13, 13)
  1196.         G.DrawEllipse(New Pen(Color.FromArgb(15, Color.White)), 1, -1, 15, 15)
  1197.     End Sub
  1198.  
  1199. End Class
  1200.  
  1201.  
  1202. '--------------------- [ GroupBox ] --------------------
  1203. 'Creator: oVERT3Xo
  1204. 'Site: **********.net
  1205. 'Created: 11/22/2011
  1206. 'Changed: 11/23/2011
  1207. '-------------------- [ /GroupBox ] ---------------------
  1208. Public Class ReactorGroupBox : Inherits ContainerControl
  1209. #Region " Control Help - Properties & Flicker Control"
  1210.     Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  1211.     End Sub
  1212.     Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  1213.         MyBase.OnTextChanged(e)
  1214.         Invalidate()
  1215.     End Sub
  1216. #End Region
  1217.  
  1218.     Sub New()
  1219.         MyBase.New()
  1220.         BackColor = Color.FromArgb(33, 33, 33)
  1221.     End Sub
  1222.  
  1223.     Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  1224.         MyBase.OnPaint(e)
  1225.         Dim G As Graphics = e.Graphics
  1226.  
  1227.         G.Clear(BackColor)
  1228.         G.SmoothingMode = SmoothingMode.HighQuality
  1229.  
  1230.         Dim DrawGradientBrush2 As New LinearGradientBrush(New Rectangle(0, 0, Width, 24), Color.FromArgb(10, 10, 10), Color.FromArgb(50, 50, 50), 90S)
  1231.  
  1232.         G.FillRectangle(DrawGradientBrush2, New Rectangle(0, 0, Width, 24))
  1233.         Dim gloss As New LinearGradientBrush(New Rectangle(0, 0, Width, 12), Color.FromArgb(60, Color.White), Color.FromArgb(20, Color.White), 90S)
  1234.         G.FillRectangle(gloss, New Rectangle(0, 0, Width, 12))
  1235.         G.DrawLine(Pens.Black, 0, 24, Width, 24)
  1236.  
  1237.         G.DrawRectangle((New Pen(New SolidBrush(Color.Black))), New Rectangle(1, 1, Width - 3, Height - 3))
  1238.         G.DrawRectangle((New Pen(New SolidBrush(Color.FromArgb(70, 70, 70)))), New Rectangle(0, 0, Width - 1, Height - 1))
  1239.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, Width, 0)
  1240.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), 0, 0, 0, Height)
  1241.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(45, 45, 45))), Width - 1, 0, Width - 1, Height)
  1242.         G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(31, 31, 31))), 2, 2, Width - 3, 2)
  1243.  
  1244.         G.DrawString(Text, Font, Brushes.Black, Width / 2 - (3 * Text.Length) + 1, 6)
  1245.         G.DrawString(Text, Font, Brushes.White, Width / 2 - (3 * Text.Length) + 1, 7)
  1246.     End Sub
  1247. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement