Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Drawing.Drawing2D
- Imports System.ComponentModel
- '--------------------- [ THEME ] ---------------------
- 'Name: QubeTheme
- 'Creator: 0xabad1dea
- 'Credit: Temploit
- 'Created: 30.08.2014
- '-------------------- [ /THEME ] ---------------------
- Class QubeForm
- Inherits ThemeContainer154
- #Region "Functions | Create form"
- Private CreateRoundPath As GraphicsPath
- #End Region
- Private _LeftPanelSize As Integer
- <Category("Options")> _
- Public Property PanelSize As Integer
- Get
- Return _LeftPanelSize
- End Get
- Set(value As Integer)
- _LeftPanelSize = value
- End Set
- End Property
- Sub New()
- DoubleBuffered = True
- _LeftPanelSize = 4
- Size = New Size(396, 235)
- End Sub
- Protected Overrides Sub ColorHook()
- BackColor = Color.FromArgb(255, 255, 255)
- Font = New Font("Segoe UI", 15, FontStyle.Regular)
- End Sub
- Protected Overrides Sub PaintHook()
- TransparencyKey = Color.Fuchsia
- G.Clear(Color.Fuchsia)
- G.SmoothingMode = SmoothingMode.Default
- G.TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit
- G.InterpolationMode = InterpolationMode.HighQualityBicubic
- Dim GP2 As GraphicsPath = CreateRound(New Rectangle(-1, -1, Width, Height + 2), 1)
- G.FillPath(New SolidBrush(Color.FromArgb(255, 255, 255)), GP2)
- G.SmoothingMode = SmoothingMode.HighQuality
- G.SmoothingMode = SmoothingMode.HighQuality
- Dim GP3 As GraphicsPath = CreateRound(New Rectangle(-1, -1, Width / _LeftPanelSize, Height + 2), 1)
- G.FillPath(New SolidBrush(Color.FromArgb(68, 76, 99)), GP3)
- G.SmoothingMode = SmoothingMode.HighQuality
- End Sub
- End Class
- Class QubeWhiteTextbox : Inherits Control
- Dim WithEvents _tb As New TextBox
- #Region "Declaration and shits"
- Public Function RoundRect(ByVal rectangle As Rectangle, ByVal curve As Integer) As GraphicsPath
- Dim p As GraphicsPath = New GraphicsPath()
- Dim arcRectangleWidth As Integer = curve * 2
- p.AddArc(New Rectangle(rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -180, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -90, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 0, 90)
- p.AddArc(New Rectangle(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 90, 90)
- p.AddLine(New Point(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y), New Point(rectangle.X, curve + rectangle.Y))
- Return p
- End Function
- Public Function RoundRect(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal curve As Integer) As GraphicsPath
- Dim rectangle As Rectangle = New Rectangle(x, y, width, height)
- Dim p As GraphicsPath = New GraphicsPath()
- Dim arcRectangleWidth As Integer = curve * 2
- p.AddArc(New Rectangle(rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -180, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -90, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 0, 90)
- p.AddArc(New Rectangle(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 90, 90)
- p.AddLine(New Point(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y), New Point(rectangle.X, curve + rectangle.Y))
- Return p
- End Function
- Private _allowpassword As Boolean = False
- Public Shadows Property UseSystemPasswordChar() As Boolean
- Get
- Return _allowpassword
- End Get
- Set(ByVal value As Boolean)
- _tb.UseSystemPasswordChar = UseSystemPasswordChar
- _allowpassword = value
- Invalidate()
- End Set
- End Property
- Private _maxChars As Integer = 32767
- Public Shadows Property MaxLength() As Integer
- Get
- Return _maxChars
- End Get
- Set(ByVal value As Integer)
- _maxChars = value
- _tb.MaxLength = MaxLength
- Invalidate()
- End Set
- End Property
- Private _textAlignment As HorizontalAlignment
- Public Shadows Property TextAlign() As HorizontalAlignment
- Get
- Return _textAlignment
- End Get
- Set(ByVal value As HorizontalAlignment)
- _textAlignment = value
- Invalidate()
- End Set
- End Property
- Private _multiLine As Boolean = False
- Public Shadows Property MultiLine() As Boolean
- Get
- Return _multiLine
- End Get
- Set(ByVal value As Boolean)
- _multiLine = value
- _tb.Multiline = value
- OnResize(EventArgs.Empty)
- Invalidate()
- End Set
- End Property
- Private _readOnly As Boolean = False
- Public Shadows Property [ReadOnly]() As Boolean
- Get
- Return _readOnly
- End Get
- Set(ByVal value As Boolean)
- _readOnly = value
- If _tb IsNot Nothing Then
- _tb.ReadOnly = value
- End If
- End Set
- End Property
- Protected Overrides Sub OnTextChanged(ByVal e As EventArgs)
- MyBase.OnTextChanged(e)
- Invalidate()
- End Sub
- Protected Overrides Sub OnBackColorChanged(ByVal e As EventArgs)
- MyBase.OnBackColorChanged(e)
- Invalidate()
- End Sub
- Protected Overrides Sub OnForeColorChanged(ByVal e As EventArgs)
- MyBase.OnForeColorChanged(e)
- _tb.ForeColor = ForeColor
- Invalidate()
- End Sub
- Protected Overrides Sub OnFontChanged(ByVal e As EventArgs)
- MyBase.OnFontChanged(e)
- _tb.Font = Font
- End Sub
- Protected Overrides Sub OnGotFocus(ByVal e As EventArgs)
- MyBase.OnGotFocus(e)
- _tb.Focus()
- End Sub
- Private Sub TextChangeTb() Handles _tb.TextChanged
- Text = _tb.Text
- End Sub
- Private Sub TextChng() Handles MyBase.TextChanged
- _tb.Text = Text
- End Sub
- #End Region
- Public Sub NewTextBox()
- With _tb
- .Text = String.Empty
- .BackColor = Color.FromArgb(68, 76, 99)
- .ForeColor = ForeColor
- .TextAlign = HorizontalAlignment.Center
- .BorderStyle = BorderStyle.None
- .Location = New Point(3, 3)
- .Font = New Font("Verdana", 10, FontStyle.Regular)
- .Size = New Size(Width - 3, Height - 3)
- .UseSystemPasswordChar = UseSystemPasswordChar
- End With
- End Sub
- Sub New()
- MyBase.New()
- NewTextBox()
- Controls.Add(_tb)
- SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
- DoubleBuffered = True
- TextAlign = HorizontalAlignment.Center
- BackColor = Color.FromArgb(255, 255, 255)
- ForeColor = Color.FromArgb(255, 255, 251)
- Font = New Font("Verdana", 10, FontStyle.Regular)
- Size = New Size(132, 29)
- End Sub
- Protected Overrides Sub OnPaint(ByVal e As Windows.Forms.PaintEventArgs)
- Dim b As Bitmap = New Bitmap(Width, Height)
- Dim g As Graphics = Graphics.FromImage(b)
- Dim rect As Rectangle = New Rectangle(0, 0, Width - 1, Height - 1)
- MyBase.OnPaint(e)
- g.SmoothingMode = SmoothingMode.HighQuality
- g.InterpolationMode = InterpolationMode.HighQualityBicubic
- g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
- With _tb
- .TextAlign = TextAlign
- .UseSystemPasswordChar = UseSystemPasswordChar
- End With
- g.FillPath(New SolidBrush(Color.FromArgb(68, 76, 99)), RoundRect(rect, 3))
- g.DrawPath(New Pen(Color.FromArgb(0, 182, 248)), RoundRect(rect, 3))
- e.Graphics.DrawImage(b, New Point(0, 0))
- g.Dispose() : b.Dispose()
- End Sub
- Protected Overrides Sub OnResize(e As EventArgs)
- MyBase.OnResize(e)
- If Not MultiLine Then
- Dim tbheight As Integer = _tb.Height
- _tb.Location = New Point(10, CType(((Height / 2) - (tbheight / 2) - 0), Integer))
- _tb.Size = New Size(Width - 20, tbheight)
- Else
- _tb.Location = New Point(10, 10)
- _tb.Size = New Size(Width - 20, Height - 20)
- End If
- End Sub
- End Class
- Class QubeTextbox : Inherits Control
- Dim WithEvents _tb As New TextBox
- #Region "Declaration and shits"
- Public Function RoundRect(ByVal rectangle As Rectangle, ByVal curve As Integer) As GraphicsPath
- Dim p As GraphicsPath = New GraphicsPath()
- Dim arcRectangleWidth As Integer = curve * 2
- p.AddArc(New Rectangle(rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -180, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -90, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 0, 90)
- p.AddArc(New Rectangle(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 90, 90)
- p.AddLine(New Point(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y), New Point(rectangle.X, curve + rectangle.Y))
- Return p
- End Function
- Public Function RoundRect(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal curve As Integer) As GraphicsPath
- Dim rectangle As Rectangle = New Rectangle(x, y, width, height)
- Dim p As GraphicsPath = New GraphicsPath()
- Dim arcRectangleWidth As Integer = curve * 2
- p.AddArc(New Rectangle(rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -180, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -90, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 0, 90)
- p.AddArc(New Rectangle(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 90, 90)
- p.AddLine(New Point(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y), New Point(rectangle.X, curve + rectangle.Y))
- Return p
- End Function
- Private _allowpassword As Boolean = False
- Public Shadows Property UseSystemPasswordChar() As Boolean
- Get
- Return _allowpassword
- End Get
- Set(ByVal value As Boolean)
- _tb.UseSystemPasswordChar = UseSystemPasswordChar
- _allowpassword = value
- Invalidate()
- End Set
- End Property
- Private _maxChars As Integer = 32767
- Public Shadows Property MaxLength() As Integer
- Get
- Return _maxChars
- End Get
- Set(ByVal value As Integer)
- _maxChars = value
- _tb.MaxLength = MaxLength
- Invalidate()
- End Set
- End Property
- Private _textAlignment As HorizontalAlignment
- Public Shadows Property TextAlign() As HorizontalAlignment
- Get
- Return _textAlignment
- End Get
- Set(ByVal value As HorizontalAlignment)
- _textAlignment = value
- Invalidate()
- End Set
- End Property
- Private _multiLine As Boolean = False
- Public Shadows Property MultiLine() As Boolean
- Get
- Return _multiLine
- End Get
- Set(ByVal value As Boolean)
- _multiLine = value
- _tb.Multiline = value
- OnResize(EventArgs.Empty)
- Invalidate()
- End Set
- End Property
- Private _readOnly As Boolean = False
- Public Shadows Property [ReadOnly]() As Boolean
- Get
- Return _readOnly
- End Get
- Set(ByVal value As Boolean)
- _readOnly = value
- If _tb IsNot Nothing Then
- _tb.ReadOnly = value
- End If
- End Set
- End Property
- Protected Overrides Sub OnTextChanged(ByVal e As EventArgs)
- MyBase.OnTextChanged(e)
- Invalidate()
- End Sub
- Protected Overrides Sub OnBackColorChanged(ByVal e As EventArgs)
- MyBase.OnBackColorChanged(e)
- Invalidate()
- End Sub
- Protected Overrides Sub OnForeColorChanged(ByVal e As EventArgs)
- MyBase.OnForeColorChanged(e)
- _tb.ForeColor = ForeColor
- Invalidate()
- End Sub
- Protected Overrides Sub OnFontChanged(ByVal e As EventArgs)
- MyBase.OnFontChanged(e)
- _tb.Font = Font
- End Sub
- Protected Overrides Sub OnGotFocus(ByVal e As EventArgs)
- MyBase.OnGotFocus(e)
- _tb.Focus()
- End Sub
- Private Sub TextChangeTb() Handles _tb.TextChanged
- Text = _tb.Text
- End Sub
- Private Sub TextChng() Handles MyBase.TextChanged
- _tb.Text = Text
- End Sub
- #End Region
- Public Sub NewTextBox()
- With _tb
- .Text = String.Empty
- .BackColor = Color.FromArgb(68, 76, 99)
- .ForeColor = ForeColor
- .TextAlign = HorizontalAlignment.Center
- .BorderStyle = BorderStyle.None
- .Location = New Point(3, 3)
- .Font = New Font("Verdana", 10, FontStyle.Regular)
- .Size = New Size(Width - 3, Height - 3)
- .UseSystemPasswordChar = UseSystemPasswordChar
- End With
- End Sub
- Sub New()
- MyBase.New()
- NewTextBox()
- Controls.Add(_tb)
- SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
- DoubleBuffered = True
- TextAlign = HorizontalAlignment.Center
- BackColor = Color.FromArgb(68, 76, 99)
- ForeColor = Color.FromArgb(255, 255, 251)
- Font = New Font("Verdana", 10, FontStyle.Regular)
- Size = New Size(132, 29)
- End Sub
- Protected Overrides Sub OnPaint(ByVal e As Windows.Forms.PaintEventArgs)
- Dim b As Bitmap = New Bitmap(Width, Height)
- Dim g As Graphics = Graphics.FromImage(b)
- Dim rect As Rectangle = New Rectangle(0, 0, Width - 1, Height - 1)
- MyBase.OnPaint(e)
- g.SmoothingMode = SmoothingMode.HighQuality
- g.InterpolationMode = InterpolationMode.HighQualityBicubic
- g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
- With _tb
- .TextAlign = TextAlign
- .UseSystemPasswordChar = UseSystemPasswordChar
- End With
- g.FillPath(New SolidBrush(Color.FromArgb(68, 76, 99)), RoundRect(rect, 3))
- g.DrawPath(New Pen(Color.FromArgb(0, 182, 248)), RoundRect(rect, 3))
- e.Graphics.DrawImage(b, New Point(0, 0))
- g.Dispose() : b.Dispose()
- End Sub
- Protected Overrides Sub OnResize(e As EventArgs)
- MyBase.OnResize(e)
- If Not MultiLine Then
- Dim tbheight As Integer = _tb.Height
- _tb.Location = New Point(10, CType(((Height / 2) - (tbheight / 2) - 0), Integer))
- _tb.Size = New Size(Width - 20, tbheight)
- Else
- _tb.Location = New Point(10, 10)
- _tb.Size = New Size(Width - 20, Height - 20)
- End If
- End Sub
- End Class
- Class QubeButton : Inherits Control
- Dim _state As MouseState
- #Region "Declaration and shits"
- Public Function RoundRect(ByVal rectangle As Rectangle, ByVal curve As Integer) As GraphicsPath
- Dim p As GraphicsPath = New GraphicsPath()
- Dim arcRectangleWidth As Integer = curve * 2
- p.AddArc(New Rectangle(rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -180, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -90, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 0, 90)
- p.AddArc(New Rectangle(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 90, 90)
- p.AddLine(New Point(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y), New Point(rectangle.X, curve + rectangle.Y))
- Return p
- End Function
- Public Function RoundRect(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal curve As Integer) As GraphicsPath
- Dim rectangle As Rectangle = New Rectangle(x, y, width, height)
- Dim p As GraphicsPath = New GraphicsPath()
- Dim arcRectangleWidth As Integer = curve * 2
- p.AddArc(New Rectangle(rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -180, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -90, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 0, 90)
- p.AddArc(New Rectangle(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 90, 90)
- p.AddLine(New Point(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y), New Point(rectangle.X, curve + rectangle.Y))
- Return p
- End Function
- Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
- MyBase.OnMouseDown(e)
- _state = MouseState.Down
- Invalidate()
- End Sub
- Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs)
- MyBase.OnMouseUp(e)
- _state = MouseState.Over
- Invalidate()
- End Sub
- Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs)
- MyBase.OnMouseEnter(e)
- _state = MouseState.Over
- Invalidate()
- End Sub
- Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs)
- MyBase.OnMouseLeave(e)
- _state = MouseState.None
- Invalidate()
- End Sub
- #End Region
- Sub New()
- SetStyle(ControlStyles.UserPaint Or ControlStyles.ResizeRedraw Or ControlStyles.SupportsTransparentBackColor, True)
- BackColor = Color.Transparent
- DoubleBuffered = True
- Size = New Size(56, 17)
- _state = MouseState.None
- End Sub
- Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
- Dim b As Bitmap = New Bitmap(Width, Height)
- Dim g As Graphics = Graphics.FromImage(b)
- Dim rect As Rectangle = New Rectangle(0, 0, Width - 1, Height - 1)
- Dim btnfont As New Font("Verdana", 10, FontStyle.Regular)
- MyBase.OnPaint(e)
- g.SmoothingMode = SmoothingMode.HighQuality
- g.InterpolationMode = InterpolationMode.HighQualityBicubic
- g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
- g.Clear(BackColor)
- Dim buttonrect As New LinearGradientBrush(rect, Color.FromArgb(68, 76, 99), Color.FromArgb(68, 76, 99), LinearGradientMode.Vertical)
- g.FillPath(buttonrect, RoundRect(rect, 3))
- g.DrawPath(New Pen(Brushes.Gray), RoundRect(rect, 3))
- Select Case _state
- Case MouseState.None
- Dim buttonrectnone As New LinearGradientBrush(rect, Color.FromArgb(68, 76, 99), Color.FromArgb(68, 76, 99), LinearGradientMode.Vertical)
- g.FillPath(buttonrectnone, RoundRect(rect, 3))
- g.DrawPath(New Pen(Color.FromArgb(68, 76, 99)), RoundRect(rect, 3))
- g.DrawString(Text, btnfont, Brushes.White, New Rectangle(0, 0, Width - 1, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- Case MouseState.Down
- Dim buttonrectnone As New LinearGradientBrush(rect, Color.FromArgb(105, 120, 149), Color.FromArgb(105, 120, 149), LinearGradientMode.Vertical)
- g.FillPath(buttonrectnone, RoundRect(rect, 3))
- g.DrawPath(New Pen(Color.FromArgb(105, 120, 149)), RoundRect(rect, 3))
- g.DrawString(Text, btnfont, Brushes.White, New Rectangle(0, 0, Width - 1, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- Case MouseState.Over
- Dim buttonrectnone As New LinearGradientBrush(rect, Color.FromArgb(68, 76, 99), Color.FromArgb(68, 76, 99), LinearGradientMode.Vertical)
- g.FillPath(buttonrectnone, RoundRect(rect, 3))
- g.DrawPath(New Pen(Color.FromArgb(68, 76, 99)), RoundRect(rect, 3))
- g.DrawString(Text, btnfont, Brushes.White, New Rectangle(0, 0, Width - 1, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- End Select
- e.Graphics.DrawImage(b, New Point(0, 0))
- g.Dispose() : b.Dispose()
- End Sub
- End Class
- Class QubeProgressBar
- Inherits Control
- #Region " Properties "
- Dim WithEvents Pgs As New ProgressBar()
- Sub New()
- Size = New Point(132, 14)
- End Sub
- Private _Maximum As Double
- Public Property Maximum() As Double
- Get
- Return _Maximum
- End Get
- Set(ByVal v As Double)
- _Maximum = v
- Progress = _Current / v * 100
- Invalidate()
- End Set
- End Property
- Private _Current As Double
- Public Property Current() As Double
- Get
- Return _Current
- End Get
- Set(ByVal v As Double)
- _Current = v
- Progress = v / _Maximum * 100
- Invalidate()
- End Set
- End Property
- Private _Progress As Double
- Public Property Progress() As Double
- Get
- Return _Progress
- End Get
- Set(ByVal v As Double)
- If v < 0 Then v = 0 Else If v > 100 Then v = 100
- _Progress = v
- _Current = v * 0.01 * _Maximum
- Invalidate()
- End Set
- End Property
- Private _ShowPercentage As Boolean = True
- Public Property ShowPercentage() As Boolean
- Get
- Return _ShowPercentage
- End Get
- Set(ByVal v As Boolean)
- _ShowPercentage = v
- Invalidate()
- End Set
- End Property
- #End Region
- #Region "Couleur"
- Protected Overrides Sub OnPaintBackground(ByVal pevent As PaintEventArgs)
- End Sub
- Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
- Using B As New Bitmap(Width, Height)
- Using G = Graphics.FromImage(B)
- G.Clear(Color.FromArgb(68, 76, 99))
- Dim Glow As New LinearGradientBrush(New Rectangle(3, 3, Width - 7, Height - 7), Color.FromArgb(54, 62, 83), Color.FromArgb(54, 62, 83), -270S)
- G.FillRectangle(Glow, New Rectangle(3, 3, Width - 7, Height - 7)) '54,62,83
- G.DrawRectangle(New Pen(Color.FromArgb(54, 62, 83)), New Rectangle(3, 3, Width - 7, Height - 7))
- Dim W = CInt(_Progress * 0.01 * Width)
- Dim R As New Rectangle(3, 3, W - 7, Height - 6)
- Dim Header As New LinearGradientBrush(R, Color.FromArgb(0, 182, 248), Color.FromArgb(0, 182, 248), 270S)
- G.FillRectangle(Header, R)
- G.FillRectangle(New SolidBrush(Color.FromArgb(3, Color.White)), R.X, R.Y, R.Width, CInt(R.Height * 0.25))
- End Using
- e.Graphics.DrawImage(B, 0, 0)
- End Using
- MyBase.OnPaint(e)
- End Sub
- #End Region
- End Class
- Class QubeWhiteProgressBar
- Inherits Control
- #Region " Properties "
- Dim WithEvents Pgs As New ProgressBar()
- Sub New()
- Size = New Point(132, 14)
- End Sub
- Private _Maximum As Double
- Public Property Maximum() As Double
- Get
- Return _Maximum
- End Get
- Set(ByVal v As Double)
- _Maximum = v
- Progress = _Current / v * 100
- Invalidate()
- End Set
- End Property
- Private _Current As Double
- Public Property Current() As Double
- Get
- Return _Current
- End Get
- Set(ByVal v As Double)
- _Current = v
- Progress = v / _Maximum * 100
- Invalidate()
- End Set
- End Property
- Private _Progress As Double
- Public Property Progress() As Double
- Get
- Return _Progress
- End Get
- Set(ByVal v As Double)
- If v < 0 Then v = 0 Else If v > 100 Then v = 100
- _Progress = v
- _Current = v * 0.01 * _Maximum
- Invalidate()
- End Set
- End Property
- Private _ShowPercentage As Boolean = True
- Public Property ShowPercentage() As Boolean
- Get
- Return _ShowPercentage
- End Get
- Set(ByVal v As Boolean)
- _ShowPercentage = v
- Invalidate()
- End Set
- End Property
- #End Region
- #Region "Couleur"
- Protected Overrides Sub OnPaintBackground(ByVal pevent As PaintEventArgs)
- End Sub
- Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
- Using B As New Bitmap(Width, Height)
- Using G = Graphics.FromImage(B)
- G.Clear(Color.FromArgb(255, 255, 255))
- Dim Glow As New LinearGradientBrush(New Rectangle(3, 3, Width - 7, Height - 7), Color.FromArgb(54, 62, 83), Color.FromArgb(54, 62, 83), -270S)
- G.FillRectangle(Glow, New Rectangle(3, 3, Width - 7, Height - 7)) '54,62,83
- G.DrawRectangle(New Pen(Color.FromArgb(54, 62, 83)), New Rectangle(3, 3, Width - 7, Height - 7))
- Dim W = CInt(_Progress * 0.01 * Width)
- Dim R As New Rectangle(3, 3, W - 7, Height - 6)
- Dim Header As New LinearGradientBrush(R, Color.FromArgb(0, 182, 248), Color.FromArgb(0, 182, 248), 270S)
- G.FillRectangle(Header, R)
- G.FillRectangle(New SolidBrush(Color.FromArgb(3, Color.White)), R.X, R.Y, R.Width, CInt(R.Height * 0.25))
- End Using
- e.Graphics.DrawImage(B, 0, 0)
- End Using
- MyBase.OnPaint(e)
- End Sub
- #End Region
- End Class
- <DefaultEvent("CheckedChanged")> Class QubeCheckBox : Inherits Control
- #Region " Control Help - MouseState & Flicker Control"
- Private State As MouseState = MouseState.None
- Public Function RoundRect(ByVal rectangle As Rectangle, ByVal curve As Integer) As GraphicsPath
- Dim p As GraphicsPath = New GraphicsPath()
- Dim arcRectangleWidth As Integer = curve * 2
- p.AddArc(New Rectangle(rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -180, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -90, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 0, 90)
- p.AddArc(New Rectangle(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 90, 90)
- p.AddLine(New Point(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y), New Point(rectangle.X, curve + rectangle.Y))
- Return p
- End Function
- Public Function RoundRect(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal curve As Integer) As GraphicsPath
- Dim rectangle As Rectangle = New Rectangle(x, y, width, height)
- Dim p As GraphicsPath = New GraphicsPath()
- Dim arcRectangleWidth As Integer = curve * 2
- p.AddArc(New Rectangle(rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -180, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Y, arcRectangleWidth, arcRectangleWidth), -90, 90)
- p.AddArc(New Rectangle(rectangle.Width - arcRectangleWidth + rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 0, 90)
- p.AddArc(New Rectangle(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y, arcRectangleWidth, arcRectangleWidth), 90, 90)
- p.AddLine(New Point(rectangle.X, rectangle.Height - arcRectangleWidth + rectangle.Y), New Point(rectangle.X, curve + rectangle.Y))
- Return p
- End Function
- Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
- MyBase.OnMouseEnter(e)
- State = MouseState.Over
- Invalidate()
- End Sub
- Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
- MyBase.OnMouseDown(e)
- State = MouseState.Down
- Invalidate()
- End Sub
- Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
- MyBase.OnMouseLeave(e)
- State = MouseState.None
- Invalidate()
- End Sub
- Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
- MyBase.OnMouseUp(e)
- State = MouseState.Over
- Invalidate()
- End Sub
- Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
- MyBase.OnTextChanged(e)
- Invalidate()
- End Sub
- Private _Checked As Boolean
- Property Checked() As Boolean
- Get
- Return _Checked
- End Get
- Set(ByVal value As Boolean)
- _Checked = value
- Invalidate()
- End Set
- End Property
- Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
- MyBase.OnResize(e)
- Height = 14
- End Sub
- Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
- _Checked = Not _Checked
- RaiseEvent CheckedChanged(Me)
- MyBase.OnClick(e)
- End Sub
- Event CheckedChanged(ByVal sender As Object)
- #End Region
- Sub New()
- MyBase.New()
- SetStyle(ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor Or ControlStyles.OptimizedDoubleBuffer, True)
- BackColor = Color.Transparent
- ForeColor = Color.Black
- Font = New Font("Verdana", 8, FontStyle.Regular)
- Size = New Size(145, 16)
- DoubleBuffered = True
- End Sub
- Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
- Dim B As New Bitmap(Width, Height)
- Dim G As Graphics = Graphics.FromImage(B)
- Dim checkBoxRectangle As New Rectangle(0, 0, Height, Height - 1)
- Dim Inner As New Rectangle(0, 0, Height, Height - 1)
- G.SmoothingMode = SmoothingMode.HighQuality
- G.InterpolationMode = InterpolationMode.HighQualityBicubic
- G.CompositingQuality = CompositingQuality.HighQuality
- G.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
- G.Clear(Color.Transparent)
- Dim bodyGrad As New LinearGradientBrush(checkBoxRectangle, Color.FromArgb(68, 76, 99), Color.FromArgb(68, 76, 99), 90S)
- 'G.FillRectangle(bodyGrad, bodyGrad.Rectangle)
- G.FillPath(New SolidBrush(Color.FromArgb(68, 76, 99)), RoundRect(checkBoxRectangle, 3))
- 'G.DrawRectangle(New Pen(Color.FromArgb(26, 26, 26)), checkBoxRectangle)
- 'G.DrawRectangle(New Pen(Color.FromArgb(0, 182, 248)), RoundRect(Inner, 3))
- 'G.FillPath(New SolidBrush(Color.FromArgb(0, 182, 248)), RoundRect(Inner, 2))
- If Checked Then
- Dim t As New Font("Marlett", 10, FontStyle.Regular)
- G.DrawString("a", t, New SolidBrush(Color.FromArgb(222, 222, 222)), -1.5, 0)
- ' G.FillPath(New SolidBrush(Color.FromArgb(0, 182, 248)), RoundRect(Inner, 3))
- 'G.DrawRectangle(New Pen(Color.FromArgb(0, 182, 248)), Inner)
- End If
- Dim drawFont As New Font("Verdana", 8, FontStyle.Regular)
- Dim nb As Brush = New SolidBrush(Color.FromArgb(68, 76, 99))
- G.DrawString(Text, drawFont, nb, New Point(18, 7), New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center})
- e.Graphics.DrawImage(B.Clone(), 0, 0)
- G.Dispose() : B.Dispose()
- End Sub
- End Class
- Class QubeTabControl
- '----------------------------
- 'AviraTabControl
- 'Creator: Temploit
- 'Version: 1.1
- 'Created: 3rd of May / ~1.5hr
- '----------------------------
- Inherits TabControl
- Private BC As Color = Color.FromArgb(68, 76, 99)
- Private UTC As Brush = New SolidBrush(Color.FromArgb(125, 146, 166))
- Private STC As Brush = Brushes.White
- Private BCB As SolidBrush = New SolidBrush(BC)
- Private BCP As Pen = New Pen(BC)
- Private TR, InR, LR, ImR As Rectangle
- Private SF As StringFormat = New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center}
- Private ICounter As Integer = 0
- Sub New()
- SetStyle(ControlStyles.UserPaint Or ControlStyles.Opaque Or ControlStyles.ResizeRedraw Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.Opaque, True)
- SetStyle(ControlStyles.Selectable, False)
- SizeMode = TabSizeMode.Fixed
- Alignment = TabAlignment.Left
- ItemSize = New Size(35, 93)
- DrawMode = TabDrawMode.OwnerDrawFixed
- Font = New Font("Verdana", 8)
- End Sub
- Protected Overrides Sub OnPaint(e As PaintEventArgs)
- MyBase.OnPaint(e)
- Dim g As Graphics = e.Graphics
- If Not SelectedIndex = Nothing AndAlso Not SelectedIndex = -1 AndAlso Not SelectedIndex > TabPages.Count - 1 AndAlso Not TabPages(SelectedIndex).BackColor = Color.Transparent Then
- g.Clear(TabPages(SelectedIndex).BackColor)
- Else
- g.Clear(Color.White)
- End If
- ICounter = 0
- LR = New Rectangle(0, 0, ItemSize.Height + 3, Height)
- g.FillRectangle(BCB, LR)
- g.DrawRectangle(BCP, LR)
- g.SmoothingMode = SmoothingMode.AntiAlias
- For i = 0 To TabCount - 1
- TR = GetTabRect(i)
- TR = New Rectangle(TR.X, TR.Y, TR.Width - 1, TR.Height)
- If TabPages(i).Tag IsNot Nothing AndAlso TabPages(i).Tag IsNot String.Empty Then
- InR = New Rectangle(TR.X + 10, TR.Y, TR.Width - 10, TR.Height)
- ICounter += 1
- Else
- If i = SelectedIndex Then
- InR = New Rectangle(TR.X + 36, TR.Y, TR.Width - 36, TR.Height)
- g.DrawString(TabPages(i).Text, Font, STC, InR, SF)
- If SelectedImageList IsNot Nothing AndAlso SelectedImageList.Images.Count > i - ICounter AndAlso SelectedImageList.Images(i - ICounter) IsNot Nothing Then
- ImR = New Rectangle(TR.X + 13, TR.Y + ((TR.Height / 2) - 8), 16, 16)
- g.DrawImage(SelectedImageList.Images(i - ICounter), ImR)
- End If
- Else
- InR = New Rectangle(TR.X + 36, TR.Y, TR.Width - 36, TR.Height)
- g.DrawString(TabPages(i).Text, Font, UTC, InR, SF)
- If UnselectedImageList IsNot Nothing AndAlso UnselectedImageList.Images.Count > i - ICounter AndAlso UnselectedImageList.Images(i - ICounter) IsNot Nothing Then
- ImR = New Rectangle(TR.X + 13, TR.Y + ((TR.Height / 2) - 8), 16, 16)
- g.DrawImage(UnselectedImageList.Images(i - ICounter), ImR)
- End If
- End If
- End If
- Next
- g.Dispose()
- End Sub
- Private UnselectedImageList As ImageList
- Public Property ImageList_Unselected As ImageList
- Get
- Return UnselectedImageList
- End Get
- Set(value As ImageList)
- UnselectedImageList = value
- If UnselectedImageList IsNot Nothing AndAlso Not UnselectedImageList.ImageSize = New Size(16, 16) Then
- UnselectedImageList.ImageSize = New Size(16, 16)
- End If
- Invalidate()
- End Set
- End Property
- Private SelectedImageList As ImageList
- Public Property ImageList_Selected As ImageList
- Get
- Return SelectedImageList
- End Get
- Set(value As ImageList)
- SelectedImageList = value
- If SelectedImageList IsNot Nothing AndAlso Not SelectedImageList.ImageSize = New Size(16, 16) Then
- SelectedImageList.ImageSize = New Size(16, 16)
- End If
- Invalidate()
- End Set
- End Property
- Protected Overrides Sub OnSelecting(e As TabControlCancelEventArgs)
- MyBase.OnSelecting(e)
- If e.TabPage IsNot Nothing AndAlso e.TabPage.Tag IsNot Nothing AndAlso e.TabPage.Tag IsNot String.Empty AndAlso Not DesignMode Then
- e.Cancel = True
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement