Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Strict On
- Imports System.Drawing.Drawing2D
- '<info>
- ' --------------------Onlykl Theme--------------------
- ' Creator - SaketSaket (HF)
- ' UID - 1869668
- ' Inspiration & Credits to all Theme creators of HF
- ' Version - 1.0
- ' Date Created - 13st December 2014
- ' Date Modified - 13th December 2014
- '
- '
- ' For bugs & Constructive Criticism contact me on HF
- ' If you like it & want to DONATE then pm me on HF
- ' --------------------Onlykl Theme--------------------
- '<info>
- 'Please Leave Credits in Source, Do not redistribute
- Enum MouseState As Byte
- None = 0
- Over = 1
- Down = 2
- End Enum
- Public Enum AlignmentStyle
- Center
- Left
- Right
- End Enum
- Public Class OnlyklTheme : Inherits ContainerControl
- Private _mousepos As Point = New Point(0, 0)
- Private _drag As Boolean = False
- Private _icon As Icon
- Public Property Icon() As Icon
- Get
- Return _icon
- End Get
- Set(ByVal value As Icon)
- _icon = value
- Invalidate()
- End Set
- End Property
- Private _showicon As Boolean = True
- Public Property ShowIcon As Boolean
- Get
- Return _showicon
- End Get
- Set(value As Boolean)
- _showicon = value
- Invalidate()
- End Set
- End Property
- Private _showheader As Boolean = True
- Public Property ShowHeader As Boolean
- Get
- Return _showheader
- End Get
- Set(value As Boolean)
- _showheader = value
- Invalidate()
- End Set
- End Property
- Private _headerAlignment As AlignmentStyle = AlignmentStyle.Center
- Public Property HeaderAlignment As AlignmentStyle
- Get
- Return _headerAlignment
- End Get
- Set(value As AlignmentStyle)
- _headerAlignment = value
- Invalidate()
- End Set
- End Property
- Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
- MyBase.OnMouseDown(e)
- If e.Button = Windows.Forms.MouseButtons.Left And New Rectangle(15, 10, Width - 31, 45).Contains(e.Location) Then
- _drag = True : _mousepos = e.Location
- End If
- End Sub
- Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs)
- MyBase.OnMouseUp(e)
- _drag = False
- End Sub
- Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
- MyBase.OnMouseMove(e)
- If _drag Then
- Parent.Location = New Point(MousePosition.X - _mousepos.X, MousePosition.Y - _mousepos.Y)
- End If
- End Sub
- Sub New()
- MyBase.New()
- SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint, True)
- DoubleBuffered = True
- End Sub
- Protected Overrides Sub OnCreateControl()
- MyBase.OnCreateControl()
- ParentForm.FormBorderStyle = FormBorderStyle.None
- ParentForm.TransparencyKey = Color.Fuchsia
- Dock = DockStyle.Fill
- 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)
- MyBase.OnPaint(e)
- g.Clear(Color.Fuchsia)
- g.FillRectangle(New SolidBrush(Color.FromArgb(0, 70, 91)), rect)
- g.DrawRectangle(New Pen(Brushes.Black), rect)
- If ShowIcon = True Then
- Try
- g.DrawIcon(_icon, New Rectangle(5, 5, 25, 25))
- Catch : End Try
- End If
- If ShowHeader = True Then
- Select Case _headerAlignment
- Case AlignmentStyle.Left
- g.DrawString(Text, New Font("Segoe UI", 12, FontStyle.Bold), New SolidBrush(Color.FromArgb(220, 220, 220)), New Rectangle(35, 10, Width - 31, 40), New StringFormat() With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center})
- Case AlignmentStyle.Center
- g.DrawString(Text, New Font("Segoe UI", 12, FontStyle.Bold), New SolidBrush(Color.FromArgb(220, 220, 220)), New Rectangle(0, 0, Width - 1, 40), New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- Case AlignmentStyle.Right
- g.DrawString(Text, New Font("Segoe UI", 12, FontStyle.Bold), New SolidBrush(Color.FromArgb(220, 220, 220)), New Rectangle(0, 10, Width - 120, 40), New StringFormat() With {.Alignment = StringAlignment.Far, .LineAlignment = StringAlignment.Center})
- End Select
- End If
- e.Graphics.DrawImage(b, New Point(0, 0))
- g.Dispose() : b.Dispose()
- End Sub
- End Class
- Public Class OnlyklButton : Inherits Control
- Dim _state As MouseState
- 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
- Sub New()
- SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
- BackColor = Color.Transparent
- DoubleBuffered = True
- Size = New Size(160, 35)
- _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(1, 1, Width - 1, Height - 1)
- Dim btnfont As New Font("Segoe UI", 11, FontStyle.Regular)
- MyBase.OnPaint(e)
- g.SmoothingMode = SmoothingMode.HighQuality
- g.InterpolationMode = InterpolationMode.HighQualityBicubic
- g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAlias
- g.Clear(BackColor)
- Dim rectgb As New LinearGradientBrush(rect, Color.FromArgb(247, 247, 247), Color.FromArgb(255, 255, 255), LinearGradientMode.Vertical)
- g.FillRectangle(rectgb, rect)
- g.DrawRectangle(New Pen(Brushes.Black), rect)
- Select Case _state
- Case MouseState.None
- g.FillRectangle(rectgb, rect)
- g.DrawRectangle(New Pen(Brushes.Black), rect)
- g.DrawString(Text, btnfont, New SolidBrush(Color.Black), rect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- Case MouseState.Down
- g.TranslateTransform(1, 1)
- g.DrawString(Text, btnfont, New SolidBrush(Color.Black), rect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- Case MouseState.Over
- Dim rectovergb As New LinearGradientBrush(rect, Color.FromArgb(255, 255, 255), Color.FromArgb(212, 212, 212), LinearGradientMode.Vertical)
- g.FillRectangle(rectovergb, rect)
- g.DrawRectangle(New Pen(Brushes.Black), rect)
- g.DrawString(Text, btnfont, New SolidBrush(Color.Black), rect, 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
- Public Class OnlyklLabel : Inherits Control
- Private _myFont As Font = New Font("Segoe UI", 12, FontStyle.Bold)
- Public Property LabelFont As Font
- Get
- Return _myFont
- End Get
- Set(value As Font)
- _myFont = value
- Invalidate()
- End Set
- End Property
- Private _image As Image
- Public Property Image As Image
- Get
- Return _image
- End Get
- Set(value As Image)
- _image = value
- Invalidate()
- End Set
- End Property
- Sub New()
- SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
- BackColor = Color.Transparent
- DoubleBuffered = True
- Size = New Size(150, 30)
- 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.Clear(BackColor)
- g.SmoothingMode = SmoothingMode.HighQuality
- g.InterpolationMode = InterpolationMode.HighQualityBicubic
- g.FillRectangle(New SolidBrush(Color.FromArgb(0, 70, 91)), rect)
- If _image IsNot Nothing Then
- Dim imageRect As New Rectangle(3, 3, 24, 24)
- g.DrawImage(_image, imageRect)
- g.DrawString(Text, LabelFont, New SolidBrush(Color.FromArgb(255, 255, 255)), New Rectangle(30, 0, Width - 31, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center})
- Else
- g.DrawString(Text, LabelFont, New SolidBrush(Color.FromArgb(255, 255, 255)), rect, New StringFormat() With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center})
- End If
- e.Graphics.DrawImage(b, New Point(0, 0))
- g.Dispose() : b.Dispose()
- End Sub
- End Class
- Public Class OnlyklInfoLabel : Inherits Control
- Private _myFont As Font = New Font("Segoe UI", 9, FontStyle.Regular)
- Public Property LabelFont As Font
- Get
- Return _myFont
- End Get
- Set(value As Font)
- _myFont = value
- Invalidate()
- End Set
- End Property
- Private _image As Image
- Public Property Image As Image
- Get
- Return _image
- End Get
- Set(value As Image)
- _image = value
- Invalidate()
- End Set
- End Property
- Sub New()
- SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
- BackColor = Color.Transparent
- DoubleBuffered = True
- Size = New Size(400, 40)
- 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.Clear(BackColor)
- g.SmoothingMode = SmoothingMode.HighQuality
- g.InterpolationMode = InterpolationMode.HighQualityBicubic
- g.FillRectangle(New SolidBrush(Color.FromArgb(23, 88, 105)), rect)
- If _image IsNot Nothing Then
- Dim imageRect As New Rectangle(3, 3, 34, 34)
- g.DrawImage(_image, imageRect)
- g.DrawString(Text, LabelFont, New SolidBrush(Color.FromArgb(98, 141, 149)), New Rectangle(40, 0, Width - 31, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center})
- Else
- g.DrawString(Text, LabelFont, New SolidBrush(Color.FromArgb(98, 141, 149)), New Rectangle(10, 0, Width - 21, Height - 1), New StringFormat() With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center})
- End If
- e.Graphics.DrawImage(b, New Point(0, 0))
- g.Dispose() : b.Dispose()
- End Sub
- End Class
- Public Class OnlyklTextBox : Inherits Control
- Dim WithEvents _tb As New TextBox
- 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
- Private _image As Image
- Public Property Image As Image
- Get
- Return _image
- End Get
- Set(value As Image)
- _image = value
- Invalidate()
- 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
- Public Sub NewTextBox()
- With _tb
- .Text = String.Empty
- .BackColor = Color.FromArgb(0, 70, 91)
- .ForeColor = ForeColor
- .TextAlign = HorizontalAlignment.Center
- .BorderStyle = BorderStyle.None
- .Location = New Point(3, 3)
- .Font = New Font("Segoe UI", 11, 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.AllPaintingInWmPaint Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
- DoubleBuffered = True
- BackColor = Color.FromArgb(0, 70, 91)
- ForeColor = Color.FromArgb(245, 245, 245)
- Font = New Font("Segoe UI", 11, FontStyle.Regular)
- Size = New Size(200, 30)
- 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.FillRectangle(New SolidBrush(Color.FromArgb(0, 70, 91)), rect)
- g.DrawRectangle(New Pen(Brushes.White), rect)
- If _image IsNot Nothing Then
- Dim imageRect As New Rectangle(Width - 30, 3, 24, 24)
- g.DrawImage(_image, imageRect)
- End If
- 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) - 1), Integer))
- _tb.Size = New Size(Width - 40, tbheight)
- Else
- _tb.Location = New Point(10, 10)
- _tb.Size = New Size(Width - 40, Height - 20)
- End If
- End Sub
- End Class
- Public Class OnlyklControlBox : Inherits Control
- Dim _state As MouseState = MouseState.None
- Dim _x As Integer
- ReadOnly _minrect As New Rectangle(5, 2, 24, 24)
- ReadOnly _maxrect As New Rectangle(32, 2, 24, 24)
- ReadOnly _closerect As New Rectangle(59, 2, 24, 24)
- ReadOnly _mintextrect As New Rectangle(5, 4, 24, 24)
- ReadOnly _maxtextrect As New Rectangle(32, 4, 24, 24)
- ReadOnly _closetextrect As New Rectangle(59, 4, 24, 24)
- Private _minDisable As Boolean = False
- Public Property MinimumDisable As Boolean
- Get
- Return _minDisable
- End Get
- Set(value As Boolean)
- _minDisable = value
- Invalidate()
- End Set
- End Property
- Private _maxDisable As Boolean = False
- Public Property MaximumDisable As Boolean
- Get
- Return _maxDisable
- End Get
- Set(value As Boolean)
- _maxDisable = value
- Invalidate()
- End Set
- End Property
- Protected Overrides Sub OnMouseDown(ByVal e As Windows.Forms.MouseEventArgs)
- MyBase.OnMouseDown(e)
- If _x > 5 AndAlso _x < 29 Then
- If MinimumDisable = False Then
- FindForm.WindowState = FormWindowState.Minimized
- End If
- ElseIf _x > 32 AndAlso _x < 56 Then
- If MaximumDisable = False Then
- If FindForm.WindowState = FormWindowState.Maximized Then
- FindForm.WindowState = FormWindowState.Minimized
- FindForm.WindowState = FormWindowState.Normal
- Else
- FindForm.WindowState = FormWindowState.Minimized
- FindForm.WindowState = FormWindowState.Maximized
- End If
- End If
- ElseIf _x > 59 AndAlso _x < 83 Then
- FindForm.Close()
- End If
- _state = MouseState.Down : Invalidate()
- End Sub
- Protected Overrides Sub OnMouseUp(ByVal e As Windows.Forms.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
- Protected Overrides Sub OnMouseMove(ByVal e As Windows.Forms.MouseEventArgs)
- MyBase.OnMouseMove(e)
- _x = e.Location.X
- Invalidate()
- End Sub
- Sub New()
- MyBase.New()
- SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.OptimizedDoubleBuffer Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
- DoubleBuffered = True
- BackColor = Color.Transparent
- Width = 85
- Height = 30
- Anchor = AnchorStyles.Top Or AnchorStyles.Right
- 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)
- MyBase.OnPaint(e)
- g.SmoothingMode = SmoothingMode.HighQuality
- g.FillRectangle(New SolidBrush(Color.FromArgb(0, 70, 91)), _minrect)
- g.DrawRectangle(Pens.Black, _minrect)
- g.FillRectangle(New SolidBrush(Color.FromArgb(0, 70, 91)), _maxrect)
- g.DrawRectangle(Pens.Black, _maxrect)
- g.FillRectangle(New SolidBrush(Color.FromArgb(0, 70, 91)), _closerect)
- g.DrawRectangle(Pens.Black, _closerect)
- g.DrawString("0", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _mintextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- If FindForm.WindowState = FormWindowState.Maximized Then
- g.DrawString("2", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _maxtextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- Else
- g.DrawString("1", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _maxtextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- End If
- g.DrawString("r", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _closetextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- Select Case _state
- Case MouseState.None
- g.FillRectangle(New SolidBrush(Color.FromArgb(0, 70, 91)), _minrect)
- g.DrawRectangle(Pens.Black, _minrect)
- g.FillRectangle(New SolidBrush(Color.FromArgb(0, 70, 91)), _maxrect)
- g.DrawRectangle(Pens.Black, _maxrect)
- g.FillRectangle(New SolidBrush(Color.FromArgb(0, 70, 91)), _closerect)
- g.DrawRectangle(Pens.Black, _closerect)
- g.DrawString("0", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _mintextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- If FindForm.WindowState = FormWindowState.Maximized Then
- g.DrawString("2", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _maxtextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- Else
- g.DrawString("1", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _maxtextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- End If
- g.DrawString("r", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _closetextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- Case MouseState.Over
- If _x > 5 AndAlso _x < 29 Then
- If MinimumDisable = False Then
- g.FillRectangle(New SolidBrush(Color.FromArgb(20, 90, 111)), _minrect)
- g.DrawRectangle(Pens.Black, _minrect)
- g.DrawString("0", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(255, 255, 255)), _mintextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- End If
- ElseIf _x > 32 AndAlso _x < 56 Then
- If MaximumDisable = False Then
- g.FillRectangle(New SolidBrush(Color.FromArgb(20, 90, 111)), _maxrect)
- g.DrawRectangle(Pens.Black, _maxrect)
- End If
- If FindForm.WindowState = FormWindowState.Maximized Then
- g.DrawString("2", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(255, 255, 255)), _maxtextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- Else
- g.DrawString("1", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(255, 255, 255)), _maxtextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- End If
- ElseIf _x > 59 AndAlso _x < 83 Then
- g.FillRectangle(New SolidBrush(Color.FromArgb(20, 90, 111)), _closerect)
- g.DrawRectangle(Pens.Black, _closerect)
- g.DrawString("r", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(255, 255, 255)), _closetextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- End If
- Case Else
- If MinimumDisable = False Then
- g.FillRectangle(New SolidBrush(Color.FromArgb(0, 70, 91)), _minrect)
- g.DrawRectangle(Pens.Black, _minrect)
- End If
- If MaximumDisable = False Then
- g.FillRectangle(New SolidBrush(Color.FromArgb(0, 70, 91)), _maxrect)
- g.DrawRectangle(Pens.Black, _maxrect)
- End If
- g.FillRectangle(New SolidBrush(Color.FromArgb(0, 70, 91)), _closerect)
- g.DrawRectangle(Pens.Black, _closerect)
- g.DrawString("0", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _mintextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- If FindForm.WindowState = FormWindowState.Maximized Then
- g.DrawString("2", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _maxtextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- Else
- g.DrawString("1", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _maxtextrect, New StringFormat() With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center})
- End If
- g.DrawString("r", New Font("Marlett", 11.5), New SolidBrush(Color.FromArgb(0, 0, 0)), _closetextrect, 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
Advertisement
Add Comment
Please, Sign In to add comment