Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Drawing
- Imports System.Drawing.Drawing2D
- '[ ----------------- ]
- ' Theme: Bleu Theme
- ' -----------
- 'Creator: ZeekoSec
- 'HF UID: 2543606
- 'Created: 04-02-2015
- 'Le Credits
- ' [ ~ -------- ~ ]
- ' Earn
- ' Aeonhack
- '[ ----------------- ]
- Class BleuTheme
- Inherits ContainerControl
- #Region " Mouse States "
- Enum MouseState As Byte
- None = 0
- Over = 1
- Down = 2
- Block = 3
- End Enum
- Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
- MyBase.OnMouseDown(e)
- If e.Button = Windows.Forms.MouseButtons.Left And New Rectangle(0, 0, Width, MoveHeight).Contains(e.Location) Then
- Dwn = True
- MousePoint = e.Location
- End If
- End Sub
- Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
- MyBase.OnMouseUp(e)
- Dwn = False
- End Sub
- Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
- MyBase.OnMouseMove(e)
- If Dwn Then
- Parent.Location = MousePosition - MousePoint
- End If
- End Sub
- #End Region
- #Region " Variables"
- Private Dwn As Boolean = False
- Private MousePoint As New Point(0, 0)
- Private MoveHeight = 32
- #End Region
- Protected Overrides Sub OnCreateControl()
- MyBase.OnCreateControl()
- ParentForm.FormBorderStyle = FormBorderStyle.None
- ParentForm.AllowTransparency = False
- ParentForm.TransparencyKey = Color.Fuchsia
- ParentForm.FindForm.StartPosition = FormStartPosition.CenterScreen
- Dock = DockStyle.Fill
- Invalidate()
- End Sub
- Public Function RoundRec(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
- Protected Overrides Sub OnPaint(e As PaintEventArgs)
- MyBase.OnPaint(e)
- Dim G = e.Graphics
- G.Clear(Color.Fuchsia)
- G.FillPath(New SolidBrush(Color.FromArgb(40, 181, 202)), RoundRec(New Rectangle(0, 0, Width, Height), 3))
- G.FillRectangle(New SolidBrush(Color.FromArgb(26, 26, 26)), 9, 32, Width - (9 * 2), Height - (32 + 9))
- G.DrawString("BleuTheme", New Font("Arial", 11), New SolidBrush(Color.FromArgb(255, 255, 255)), New Point(7, 7))
- G.Dispose()
- End Sub
- End Class
- Class BleuButton
- Inherits Button
- Sub New()
- Size = New Point(110, 30)
- Font = New Font("Arial", 9, FontStyle.Regular)
- AutoEllipsis = False
- ForeColor = Color.White
- BackColor = Color.FromArgb(40, 181, 202)
- FlatStyle = Windows.Forms.FlatStyle.Flat
- FlatAppearance.BorderSize = 0
- FlatAppearance.BorderColor = Color.FromArgb(22, 162, 183)
- FlatAppearance.MouseDownBackColor = Color.FromArgb(24, 142, 159)
- FlatAppearance.MouseOverBackColor = Color.FromArgb(40, 181, 202)
- End Sub
- End Class
- Public Class BleuTextBox
- Inherits Control
- #Region " Variables "
- Public WithEvents BleuTextBox As New TextBox
- Private _maxchars As Integer = 32767
- Private _ReadOnly As Boolean
- Private _Multiline As Boolean
- Private ALNType As HorizontalAlignment
- Private isPasswordMasked As Boolean = False
- #End Region
- #Region " Properties "
- Public Shadows Property TextAlignment() As HorizontalAlignment
- Get
- Return ALNType
- End Get
- Set(ByVal Val As HorizontalAlignment)
- ALNType = Val
- Invalidate()
- End Set
- End Property
- Public Shadows Property MaxLength() As Integer
- Get
- Return _maxchars
- End Get
- Set(ByVal Val As Integer)
- _maxchars = Val
- BleuTextBox.MaxLength = MaxLength
- Invalidate()
- End Set
- End Property
- Public Shadows Property UseSystemPasswordChar() As Boolean
- Get
- Return isPasswordMasked
- End Get
- Set(ByVal Val As Boolean)
- BleuTextBox.UseSystemPasswordChar = UseSystemPasswordChar
- isPasswordMasked = Val
- Invalidate()
- End Set
- End Property
- Property [ReadOnly]() As Boolean
- Get
- Return _ReadOnly
- End Get
- Set(ByVal value As Boolean)
- _ReadOnly = value
- If BleuTextBox IsNot Nothing Then
- BleuTextBox.ReadOnly = value
- End If
- End Set
- End Property
- Property Multiline() As Boolean
- Get
- Return _Multiline
- End Get
- Set(ByVal value As Boolean)
- _Multiline = value
- If BleuTextBox IsNot Nothing Then
- BleuTextBox.Multiline = value
- If value Then
- BleuTextBox.Height = Height - 10
- Else
- Height = BleuTextBox.Height + 10
- End If
- End If
- End Set
- End Property
- #End Region
- #Region " EventArgs "
- Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
- MyBase.OnTextChanged(e)
- Invalidate()
- End Sub
- Protected Overrides Sub OnBackColorChanged(ByVal e As System.EventArgs)
- MyBase.OnBackColorChanged(e)
- BleuTextBox.BackColor = BackColor
- Invalidate()
- End Sub
- Protected Overrides Sub OnForeColorChanged(ByVal e As System.EventArgs)
- MyBase.OnForeColorChanged(e)
- BleuTextBox.ForeColor = ForeColor
- Invalidate()
- End Sub
- Protected Overrides Sub OnFontChanged(ByVal e As System.EventArgs)
- MyBase.OnFontChanged(e)
- BleuTextBox.Font = Font
- End Sub
- Private Sub _OnKeyDown(ByVal Obj As Object, ByVal e As KeyEventArgs)
- If e.Control AndAlso e.KeyCode = Keys.A Then
- BleuTextBox.SelectAll()
- e.SuppressKeyPress = True
- End If
- If e.Control AndAlso e.KeyCode = Keys.C Then
- BleuTextBox.Copy()
- e.SuppressKeyPress = True
- End If
- End Sub
- Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
- MyBase.OnResize(e)
- If _Multiline Then
- BleuTextBox.Height = Height - 10
- Else
- Height = BleuTextBox.Height + 10
- End If
- End Sub
- Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
- MyBase.OnGotFocus(e)
- BleuTextBox.Focus()
- End Sub
- Sub _TextChanged() Handles BleuTextBox.TextChanged
- Text = BleuTextBox.Text
- End Sub
- Sub _BaseTextChanged() Handles MyBase.TextChanged
- BleuTextBox.Text = Text
- End Sub
- #End Region
- Sub AddTextBox()
- With BleuTextBox
- .BackColor = BackColor
- .ForeColor = ForeColor
- .Size = New Size(Width - 10, 27)
- .Location = New Point(7, 5)
- .Text = String.Empty
- .BorderStyle = BorderStyle.None
- .TextAlign = HorizontalAlignment.Left
- .Font = New Font("Tahoma", 10)
- .UseSystemPasswordChar = UseSystemPasswordChar
- .Multiline = False
- End With
- AddHandler BleuTextBox.KeyDown, AddressOf _OnKeyDown
- End Sub
- Sub New()
- MyBase.New()
- AddTextBox()
- Controls.Add(BleuTextBox)
- SetStyle(ControlStyles.SupportsTransparentBackColor, True)
- SetStyle(ControlStyles.UserPaint, True)
- BackColor = Color.FromArgb(26, 26, 26)
- ForeColor = Color.FromArgb(225, 255, 255)
- Text = Nothing
- Font = New Font("Arial", 9)
- Size = New Size(135, 27)
- DoubleBuffered = True ' Cut off border flicker
- 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)
- G.SmoothingMode = SmoothingMode.HighQuality
- 'Height = 27
- With BleuTextBox
- .Width = Width - 10
- .TextAlign = TextAlignment
- .UseSystemPasswordChar = UseSystemPasswordChar
- '.Height = 27
- End With
- G.Clear(Color.Transparent)
- G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(40, 181, 202))), New Rectangle(0, 0, Width - 1, Height - 1))
- e.Graphics.DrawImage(B.Clone(), 0, 0)
- G.Dispose() : B.Dispose()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement