Documente Academic
Documente Profesional
Documente Cultură
Imports System.Drawing.Text
Imports System.Drawing.Drawing2D
Imports System.ComponentModel
''' <summary>
''' LogIn GDI+ Theme
''' Creator: Xertz (HF)
''' Version: 1.4
''' Control Count: 28
''' Date Created: 18/12/2013
''' Date Changed: 07/09/2014
''' UID: 1602992
''' For any bugs / errors, PM me.
''' </summary>
''' <remarks></remarks>
Module DrawHelpers
#Region "Functions"
#End Region
End Module
#Region "Declarations"
Private _CloseChoice As __CloseChoice = __CloseChoice.Form
Private _FontSize As Integer = 12
Private ReadOnly _Font As Font = New Font("Segoe UI", _FontSize)
Private MouseXLoc As Integer
Private MouseYLoc As Integer
Private CaptureMovement As Boolean = False
Private Const MoveHeight As Integer = 35
Private MouseP As Point = New Point(0, 0)
Private _FontColour As Color = Color.FromArgb(255, 255, 255)
Private _BaseColour As Color = Color.FromArgb(35, 35, 35)
Private _ContainerColour As Color = Color.FromArgb(54, 54, 54)
Private _BorderColour As Color = Color.FromArgb(60, 60, 60)
Private _HoverColour As Color = Color.FromArgb(42, 42, 42)
#End Region
MyBase.OnSizeChanged(e)
End Sub
#End Region
SetState(MouseState.Over)
If Not _SmartBounds Then Return
If IsParentMdi Then
CorrectBounds(New Rectangle(Point.Empty, Parent.Parent.Size))
Else
Try : CorrectBounds(Screen.FromControl(Parent).WorkingArea) : Catch
: End Try
End If
End If
End Sub
Private Sub CorrectBounds(ByVal bounds As Rectangle)
If Parent.Width > bounds.Width Then Parent.Width = bounds.Width
If Parent.Height > bounds.Height Then Parent.Height = bounds.Height
Dim X As Integer = Parent.Location.X
Dim Y As Integer = Parent.Location.Y
If X < bounds.X Then X = bounds.X
If Y < bounds.Y Then Y = bounds.Y
Dim Width As Integer = bounds.X + bounds.Width
Dim Height As Integer = bounds.Y + bounds.Height
If X + Parent.Width > Width Then X = Width - Parent.Width
If Y + Parent.Height > Height Then Y = Height - Parent.Height
''Weird allows proper full screen
' Parent.Size = New Size(Width, Height)
If FindForm.WindowState = FormWindowState.Maximized Or FindForm.WindowState
= FormWindowState.Minimized Then
Parent.Size = OldSize
End If
End Sub
#End Region
#Region "Properties"
Enum __CloseChoice
Form
Application
End Enum
Public Property CloseChoice As __CloseChoice
Get
Return _CloseChoice
End Get
Set(value As __CloseChoice)
_CloseChoice = value
End Set
End Property
Invalidate()
End Set
End Property
<Category("Control")>
Public Property FontSize As Integer
Get
Return _FontSize
End Get
Set(value As Integer)
_FontSize = value
End Set
End Property
Private _AllowMinimize As Boolean = True
<Category("Control")>
Public Property AllowMinimize As Boolean
Get
Return _AllowMinimize
End Get
Set(value As Boolean)
_AllowMinimize = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")>
Public Property HoverColour As Color
Get
Return _HoverColour
End Get
Set(value As Color)
_HoverColour = value
End Set
End Property
<Category("Colours")>
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")>
Public Property ContainerColour As Color
Get
Return _ContainerColour
End Get
Set(value As Color)
_ContainerColour = value
End Set
End Property
<Category("Colours")>
Public Property FontColour As Color
Get
Return _FontColour
End Get
Set(value As Color)
_FontColour = value
End Set
End Property
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer,
True)
Me.DoubleBuffered = True
Me.BackColor = _BaseColour
Me.Dock = DockStyle.Fill
End Sub
Dim G = e.Graphics
With G
.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
.SmoothingMode = SmoothingMode.HighQuality
.PixelOffsetMode = PixelOffsetMode.HighQuality
.FillRectangle(New SolidBrush(_BaseColour), New Rectangle(0, 0, Width,
Height))
.FillRectangle(New SolidBrush(_ContainerColour), New Rectangle(2, 35,
Width - 4, Height - 37))
.DrawRectangle(New Pen(_BorderColour), New Rectangle(0, 0, Width,
Height))
Dim ControlBoxPoints() As Point = {New Point(Width - 90, 0), New
Point(Width - 90, 22), New Point(Width - 15, 22), New Point(Width - 15, 0)}
.DrawLines(New Pen(_BorderColour), ControlBoxPoints)
.DrawLine(New Pen(_BorderColour), Width - 65, 0, Width - 65, 22)
GetMouseLocation = PointToClient(MousePosition)
Select Case State
Case MouseState.Over
If GetMouseLocation.X > Width - 39 AndAlso GetMouseLocation.X <
Width - 16 AndAlso GetMouseLocation.Y < 22 Then
.FillRectangle(New SolidBrush(_HoverColour), New
Rectangle(Width - 39, 0, 23, 22))
ElseIf GetMouseLocation.X > Width - 64 AndAlso
GetMouseLocation.X < Width - 41 AndAlso GetMouseLocation.Y < 22 Then
.FillRectangle(New SolidBrush(_HoverColour), New
Rectangle(Width - 64, 0, 23, 22))
ElseIf GetMouseLocation.X > Width - 89 AndAlso
GetMouseLocation.X < Width - 66 AndAlso GetMouseLocation.Y < 22 Then
.FillRectangle(New SolidBrush(_HoverColour), New
Rectangle(Width - 89, 0, 23, 22))
End If
End Select
.DrawLine(New Pen(_BorderColour), Width - 40, 0, Width - 40, 22)
''Close Button
.DrawLine(New Pen(_FontColour, 2), Width - 33, 6, Width - 22, 16)
.DrawLine(New Pen(_FontColour, 2), Width - 33, 16, Width - 22, 6)
''Minimize Button
.DrawLine(New Pen(_FontColour), Width - 83, 16, Width - 72, 16)
''Maximize Button
.DrawLine(New Pen(_FontColour), Width - 58, 16, Width - 47, 16)
.DrawLine(New Pen(_FontColour), Width - 58, 16, Width - 58, 6)
.DrawLine(New Pen(_FontColour), Width - 47, 16, Width - 47, 6)
.DrawLine(New Pen(_FontColour), Width - 58, 6, Width - 47, 6)
.DrawLine(New Pen(_FontColour), Width - 58, 7, Width - 47, 7)
If _ShowIcon Then
.DrawIcon(FindForm.Icon, New Rectangle(6, 6, 22, 22))
.DrawString(Text, _Font, New SolidBrush(_FontColour), New
RectangleF(31, 0, Width - 110, 35), New StringFormat With {.LineAlignment =
StringAlignment.Center, .Alignment = StringAlignment.Near})
Else
.DrawString(Text, _Font, New SolidBrush(_FontColour), New
RectangleF(4, 0, Width - 110, 35), New StringFormat With {.LineAlignment =
StringAlignment.Center, .Alignment = StringAlignment.Near})
End If
.InterpolationMode = CType(7, InterpolationMode)
End With
End Sub
#End Region
End Class
<DefaultEvent("TextChanged")>
Public Class LogInUserTextBox
Inherits Control
#Region "Declarations"
Private State As MouseState = MouseState.None
Private WithEvents TB As Windows.Forms.TextBox
Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
Private _TextColour As Color = Color.FromArgb(255, 255, 255)
Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
#End Region
If value Then
TB.Height = Height - 11
Else
Height = TB.Height + 11
End If
End If
End Set
End Property
<Category("Options")>
Overrides Property Text As String
Get
Return MyBase.Text
End Get
Set(ByVal value As String)
MyBase.Text = value
If TB IsNot Nothing Then
TB.Text = value
End If
End Set
End Property
<Category("Options")>
Overrides Property Font As Font
Get
Return MyBase.Font
End Get
Set(ByVal value As Font)
MyBase.Font = value
If TB IsNot Nothing Then
TB.Font = value
TB.Location = New Point(3, 5)
TB.Width = Width - 35
If _Multiline Then
TB.Height = Height - 11
Else
Height = TB.Height + 11
End If
MyBase.OnResize(e)
End Sub
#End Region
<Category("Colours")>
Public Property BackgroundColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")>
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
#End Region
#End Region
Dim G = e.Graphics
Dim GP As GraphicsPath
Dim Base As New Rectangle(0, 0, Width, Height)
With G
.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
.SmoothingMode = SmoothingMode.HighQuality
.PixelOffsetMode = PixelOffsetMode.HighQuality
.Clear(BackColor)
TB.BackColor = Color.FromArgb(42, 42, 42)
TB.ForeColor = Color.FromArgb(255, 255, 255)
GP = RoundRectangle(Base, 6)
.FillPath(New SolidBrush(Color.FromArgb(42, 42, 42)), GP)
.DrawPath(New Pen(New SolidBrush(Color.FromArgb(35, 35, 35)), 2), GP)
GP.Dispose()
.FillPie(New SolidBrush(FindForm.BackColor), New Rectangle(Width - 25,
Height - 23, Height + 25, Height + 25), 180, 90)
.DrawPie(New Pen(Color.FromArgb(35, 35, 35), 2), New Rectangle(Width -
25, Height - 23, Height + 25, Height + 25), 180, 90)
.InterpolationMode = CType(7, InterpolationMode)
End With
End Sub
#End Region
End Class
<DefaultEvent("TextChanged")>
Public Class LogInPassTextBox
Inherits Control
#Region "Declarations"
Private State As MouseState = MouseState.None
Private WithEvents TB As Windows.Forms.TextBox
Private _BaseColour As Color = Color.FromArgb(255, 255, 255)
Private _TextColour As Color = Color.FromArgb(50, 50, 50)
Private _BorderColour As Color = Color.FromArgb(180, 187, 205)
#End Region
If value Then
TB.Height = Height - 11
Else
Height = TB.Height + 11
End If
End If
End Set
End Property
<Category("Options")>
Overrides Property Text As String
Get
Return MyBase.Text
End Get
Set(ByVal value As String)
MyBase.Text = value
If TB IsNot Nothing Then
TB.Text = value
End If
End Set
End Property
<Category("Options")>
Overrides Property Font As Font
Get
Return MyBase.Font
End Get
Set(ByVal value As Font)
MyBase.Font = value
If TB IsNot Nothing Then
TB.Font = value
TB.Location = New Point(3, 5)
TB.Width = Width - 35
If _Multiline Then
TB.Height = Height - 11
Else
Height = TB.Height + 11
End If
MyBase.OnResize(e)
End Sub
#End Region
#Region "Colour Properties"
<Category("Colours")>
Public Property BackgroundColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")>
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
#End Region
#End Region
End Class
#Region "Declarations"
Private State As MouseState = MouseState.None
Private _ArcColour As Color = Color.FromArgb(43, 43, 43)
Private _ArrowColour As Color = Color.FromArgb(235, 233, 234)
Private _ArrowBorderColour As Color = Color.FromArgb(170, 170, 170)
Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
Private _HoverColour As Color = Color.FromArgb(0, 130, 169)
Private _PressedColour As Color = Color.FromArgb(0, 145, 184)
Private _NormalColour As Color = Color.FromArgb(0, 160, 199)
#End Region
#End Region
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer
Or _
ControlStyles.SupportsTransparentBackColor, True)
DoubleBuffered = True
Size = New Size(50, 50)
BackColor = Color.FromArgb(54, 54, 54)
End Sub
Dim G = e.Graphics
Dim GP, GP1 As New GraphicsPath
With G
.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
.SmoothingMode = SmoothingMode.HighQuality
.PixelOffsetMode = PixelOffsetMode.HighQuality
.Clear(BackColor)
Dim P() As Point = {New Point(18, 22), New Point(28, 22), New Point(28,
18), New Point(34, 25), New Point(28, 32), New Point(28, 28), New Point(18, 28)}
Select Case State
Case MouseState.None
.FillEllipse(New SolidBrush(Color.FromArgb(56, 56, 56)), New
Rectangle(CInt(3 / 2) + 1, CInt(3 / 2) + 1, Width - 3 - 3, Height - 3 - 3))
.DrawArc(New Pen(New SolidBrush(_ArcColour), 1 + 3), CInt(3 /
2) + 1, CInt(3 / 2) + 1, Width - 3 - 3, Height - 3 - 3, -90, 360)
.DrawEllipse(New Pen(_BorderColour), New Rectangle(1, 1, Height
- 3, Height - 3))
.FillEllipse(New SolidBrush(_NormalColour), New
Rectangle(CInt(3 / 2) + 3, CInt(3 / 2) + 3, Height - 11, Height - 11))
.FillPolygon(New SolidBrush(_ArrowColour), P)
.DrawPolygon(New Pen(_ArrowBorderColour), P)
Case MouseState.Over
.DrawArc(New Pen(New SolidBrush(_ArcColour), 1 + 3), CInt(3 /
2) + 1, CInt(3 / 2) + 1, Width - 3 - 3, Height - 3 - 3, -90, 360)
.DrawEllipse(New Pen(_BorderColour), New Rectangle(1, 1, Height
- 3, Height - 3))
.FillEllipse(New SolidBrush(_HoverColour), New Rectangle(6, 6,
Height - 13, Height - 13))
.FillPolygon(New SolidBrush(_ArrowColour), P)
.DrawPolygon(New Pen(_ArrowBorderColour), P)
Case MouseState.Down
.DrawArc(New Pen(New SolidBrush(_ArcColour), 1 + 3), CInt(3 /
2) + 1, CInt(3 / 2) + 1, Width - 3 - 3, Height - 3 - 3, -90, 360)
.DrawEllipse(New Pen(_BorderColour), New Rectangle(1, 1, Height
- 3, Height - 3))
.FillEllipse(New SolidBrush(_PressedColour), New Rectangle(6,
6, Height - 13, Height - 13))
.FillPolygon(New SolidBrush(_ArrowColour), P)
.DrawPolygon(New Pen(_ArrowBorderColour), P)
End Select
GP.Dispose()
GP1.Dispose()
.InterpolationMode = InterpolationMode.HighQualityBicubic
End With
End Sub
#End Region
End Class
<DefaultEvent("CheckedChanged")>
Public Class LogInCheckBox
Inherits Control
#Region "Declarations"
Private _Checked As Boolean
Private State As MouseState = MouseState.None
Private _CheckedColour As Color = Color.FromArgb(173, 173, 174)
Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
Private _BackColour As Color = Color.FromArgb(42, 42, 42)
Private _TextColour As Color = Color.FromArgb(255, 255, 255)
#End Region
<Category("Colours")>
Public Property BaseColour As Color
Get
Return _BackColour
End Get
Set(value As Color)
_BackColour = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")>
Public Property CheckedColour As Color
Get
Return _CheckedColour
End Get
Set(value As Color)
_CheckedColour = value
End Set
End Property
<Category("Colours")>
Public Property FontColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
#End Region
End Class
#Region "Declarations"
Private State As MouseState = MouseState.None
Private WithEvents TB As Windows.Forms.TextBox
Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
Private _TextColour As Color = Color.FromArgb(255, 255, 255)
Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
Private _Style As Styles = Styles.NotRounded
Private _TextAlign As HorizontalAlignment = HorizontalAlignment.Left
Private _MaxLength As Integer = 32767
Private _ReadOnly As Boolean
Private _UseSystemPasswordChar As Boolean
Private _Multiline As Boolean
#End Region
Enum Styles
Rounded
NotRounded
End Enum
<Category("Options")>
Property TextAlign() As HorizontalAlignment
Get
Return _TextAlign
End Get
Set(ByVal value As HorizontalAlignment)
_TextAlign = value
If TB IsNot Nothing Then
TB.TextAlign = value
End If
End Set
End Property
<Category("Options")>
Property MaxLength() As Integer
Get
Return _MaxLength
End Get
Set(ByVal value As Integer)
_MaxLength = value
If TB IsNot Nothing Then
TB.MaxLength = value
End If
End Set
End Property
<Category("Options")>
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
<Category("Options")>
Property UseSystemPasswordChar() As Boolean
Get
Return _UseSystemPasswordChar
End Get
Set(ByVal value As Boolean)
_UseSystemPasswordChar = value
If TB IsNot Nothing Then
TB.UseSystemPasswordChar = value
End If
End Set
End Property
<Category("Options")>
Property Multiline() As Boolean
Get
Return _Multiline
End Get
Set(ByVal value As Boolean)
_Multiline = value
If TB IsNot Nothing Then
TB.Multiline = value
If value Then
TB.Height = Height - 11
Else
Height = TB.Height + 11
End If
End If
End Set
End Property
<Category("Options")>
Overrides Property Text As String
Get
Return MyBase.Text
End Get
Set(ByVal value As String)
MyBase.Text = value
If TB IsNot Nothing Then
TB.Text = value
End If
End Set
End Property
<Category("Options")>
Overrides Property Font As Font
Get
Return MyBase.Font
End Get
Set(ByVal value As Font)
MyBase.Font = value
If TB IsNot Nothing Then
TB.Font = value
TB.Location = New Point(3, 5)
TB.Width = Width - 6
If _Multiline Then
TB.Height = Height - 11
Else
Height = TB.Height + 11
End If
MyBase.OnResize(e)
End Sub
#End Region
<Category("Colours")>
Public Property BackgroundColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")>
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
#End Region
#End Region
End Class
#Region "Declarations"
Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
Private _ProgressColour As Color = Color.FromArgb(23, 119, 151)
Private _Value As Integer = 0
Private _Maximum As Integer = 100
Private _StartingAngle As Integer = 110
Private _RotationAngle As Integer = 255
Private ReadOnly _Font As Font = New Font("Segoe UI", 20)
#End Region
#Region "Properties"
<Category("Control")>
Public Property Maximum() As Integer
Get
Return _Maximum
End Get
Set(V As Integer)
Select Case V
Case Is < _Value
_Value = V
End Select
_Maximum = V
Invalidate()
End Set
End Property
<Category("Control")>
Public Property Value() As Integer
Get
Select Case _Value
Case 0
Return 0
Case Else
Return _Value
End Select
End Get
Set(V As Integer)
Select Case V
Case Is > _Maximum
V = _Maximum
Invalidate()
End Select
_Value = V
Invalidate()
End Set
End Property
<Category("Colours")>
Public Property ProgressColour As Color
Get
Return _ProgressColour
End Get
Set(value As Color)
_ProgressColour = value
End Set
End Property
<Category("Colours")>
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Control")>
Public Property StartingAngle As Integer
Get
Return _StartingAngle
End Get
Set(value As Integer)
_StartingAngle = value
End Set
End Property
<Category("Control")>
Public Property RotationAngle As Integer
Get
Return _RotationAngle
End Get
Set(value As Integer)
_RotationAngle = value
End Set
End Property
#End Region
End Class
<DefaultEvent("CheckedChanged")>
Public Class LogInRadioButton
Inherits Control
#Region "Declarations"
Private _Checked As Boolean
Private State As MouseState = MouseState.None
Private _HoverColour As Color = Color.FromArgb(50, 49, 51)
Private _CheckedColour As Color = Color.FromArgb(173, 173, 174)
Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
Private _BackColour As Color = Color.FromArgb(54, 54, 54)
Private _TextColour As Color = Color.FromArgb(255, 255, 255)
#End Region
<Category("Colours")>
Public Property HighlightColour As Color
Get
Return _HoverColour
End Get
Set(value As Color)
_HoverColour = value
End Set
End Property
<Category("Colours")>
Public Property BaseColour As Color
Get
Return _BackColour
End Get
Set(value As Color)
_BackColour = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")>
Public Property CheckedColour As Color
Get
Return _CheckedColour
End Get
Set(value As Color)
_CheckedColour = value
End Set
End Property
<Category("Colours")>
Public Property FontColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
End Class
#Region "Declaration"
Private _FontColour As Color = Color.FromArgb(255, 255, 255)
#End Region
<Category("Colours")>
Public Property FontColour As Color
Get
Return _FontColour
End Get
Set(value As Color)
_FontColour = value
End Set
End Property
#End Region
Sub New()
SetStyle(ControlStyles.SupportsTransparentBackColor, True)
Font = New Font("Segoe UI", 9)
ForeColor = _FontColour
BackColor = Color.Transparent
Text = Text
End Sub
#End Region
End Class
#Region "Declarations"
Private ReadOnly _Font As New Font("Segoe UI", 9)
Private _ProgressColour As Color = Color.FromArgb(0, 191, 255)
Private _BorderColour As Color = Color.FromArgb(25, 25, 25)
Private _FontColour As Color = Color.FromArgb(255, 255, 255)
Private _MainColour As Color = Color.FromArgb(42, 42, 42)
Private _HoverColour As Color = Color.FromArgb(52, 52, 52)
Private _PressedColour As Color = Color.FromArgb(47, 47, 47)
Private State As New MouseState
#End Region
#End Region
#Region "Properties"
<Category("Colours")>
Public Property ProgressColour As Color
Get
Return _ProgressColour
End Get
Set(value As Color)
_ProgressColour = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")>
Public Property FontColour As Color
Get
Return _FontColour
End Get
Set(value As Color)
_FontColour = value
End Set
End Property
<Category("Colours")>
Public Property BaseColour As Color
Get
Return _MainColour
End Get
Set(value As Color)
_MainColour = value
End Set
End Property
<Category("Colours")>
Public Property HoverColour As Color
Get
Return _HoverColour
End Get
Set(value As Color)
_HoverColour = value
End Set
End Property
<Category("Colours")>
Public Property PressedColour As Color
Get
Return _PressedColour
End Get
Set(value As Color)
_PressedColour = value
End Set
End Property
#End Region
#End Region
End Class
#Region "Declarations"
Private _Value As Integer = 0
Private _Maximum As Integer = 100
Private _Font As New Font("Segoe UI", 9)
Private _ProgressColour As Color = Color.FromArgb(0, 191, 255)
Private _BorderColour As Color = Color.FromArgb(25, 25, 25)
Private _FontColour As Color = Color.FromArgb(255, 255, 255)
Private _MainColour As Color = Color.FromArgb(42, 42, 42)
Private _HoverColour As Color = Color.FromArgb(52, 52, 52)
Private _PressedColour As Color = Color.FromArgb(47, 47, 47)
Private State As New MouseState
#End Region
#End Region
#Region "Properties"
<Category("Colours")>
Public Property ProgressColour As Color
Get
Return _ProgressColour
End Get
Set(value As Color)
_ProgressColour = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")>
Public Property FontColour As Color
Get
Return _FontColour
End Get
Set(value As Color)
_FontColour = value
End Set
End Property
<Category("Colours")>
Public Property BaseColour As Color
Get
Return _MainColour
End Get
Set(value As Color)
_MainColour = value
End Set
End Property
<Category("Colours")>
Public Property HoverColour As Color
Get
Return _HoverColour
End Get
Set(value As Color)
_HoverColour = value
End Set
End Property
<Category("Colours")>
Public Property PressedColour As Color
Get
Return _PressedColour
End Get
Set(value As Color)
_PressedColour = value
End Set
End Property
<Category("Control")>
Public Property Maximum() As Integer
Get
Return _Maximum
End Get
Set(V As Integer)
Select Case V
Case Is < _Value
_Value = V
End Select
_Maximum = V
Invalidate()
End Set
End Property
<Category("Control")>
Public Property Value() As Integer
Get
Select Case _Value
Case 0
Return 0
Case Else
Return _Value
End Select
End Get
Set(V As Integer)
Select Case V
Case Is > _Maximum
V = _Maximum
Invalidate()
End Select
_Value = V
Invalidate()
End Set
End Property
#End Region
#End Region
End Class
#Region "Declarations"
Private _MainColour As Color = Color.FromArgb(47, 47, 47)
Private _HeaderColour As Color = Color.FromArgb(42, 42, 42)
Private _TextColour As Color = Color.FromArgb(255, 255, 255)
Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
#End Region
#Region "Properties"
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")>
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
<Category("Colours")>
Public Property HeaderColour As Color
Get
Return _HeaderColour
End Get
Set(value As Color)
_HeaderColour = value
End Set
End Property
<Category("Colours")>
Public Property MainColour As Color
Get
Return _MainColour
End Get
Set(value As Color)
_MainColour = value
End Set
End Property
#End Region
End Class
#Region "Declarations"
Private _SeperatorColour As Color = Color.FromArgb(35, 35, 35)
Private _Alignment As Style = Style.Horizontal
Private _Thickness As Single = 1
#End Region
#Region "Properties"
Enum Style
Horizontal
Verticle
End Enum
<Category("Control")>
Public Property Thickness As Single
Get
Return _Thickness
End Get
Set(value As Single)
_Thickness = value
End Set
End Property
<Category("Control")>
Public Property Alignment As Style
Get
Return _Alignment
End Get
Set(value As Style)
_Alignment = value
End Set
End Property
<Category("Colours")>
Public Property SeperatorColour As Color
Get
Return _SeperatorColour
End Get
Set(value As Color)
_SeperatorColour = value
End Set
End Property
#End Region
End Class
#Region "Variables"
#End Region
<Category("Colours")> _
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")> _
Public Property ButtonColour As Color
Get
Return _ButtonColour
End Get
Set(value As Color)
_ButtonColour = value
End Set
End Property
<Category("Colours")> _
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")> _
Public Property SecondBorderColour As Color
Get
Return _SecondBorderColour
End Get
Set(value As Color)
_SecondBorderColour = value
End Set
End Property
<Category("Colours")> _
Public Property FontColour As Color
Get
Return _FontColour
End Get
Set(value As Color)
_FontColour = value
End Set
End Property
#End Region
#Region "Draw Control"
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or _
ControlStyles.SupportsTransparentBackColor, True)
DoubleBuffered = True
Font = New Font("Segoe UI", 10)
End Sub
#End Region
End Class
#Region "Declarations"
#End Region
#Region "Properties"
<Category("Colours")>
Public Property SelectedColour As Color
Get
Return _SelectedColour
End Get
Set(value As Color)
_SelectedColour = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")>
Public Property BackColour As Color
Get
Return _BackColour
End Get
Set(value As Color)
_BackColour = value
End Set
End Property
#End Region
End Class
#Region "Variables"
#Region "Properties"
<Category("Control")> _
Public Property Items As String()
Get
Return _Items
End Get
Set(value As String())
_Items = value
ListB.Items.Clear()
ListB.Items.AddRange(value)
Invalidate()
End Set
End Property
<Category("Colours")> _
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")> _
Public Property SelectedColour As Color
Get
Return _SelectedColour
End Get
Set(value As Color)
_SelectedColour = value
End Set
End Property
<Category("Colours")> _
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")> _
Public Property ListBaseColour As Color
Get
Return _ListBaseColour
End Get
Set(value As Color)
_ListBaseColour = value
End Set
End Property
<Category("Colours")> _
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer,
True)
DoubleBuffered = True
ListB.DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
ListB.ScrollAlwaysVisible = False
ListB.HorizontalScrollbar = False
ListB.BorderStyle = BorderStyle.None
ListB.BackColor = _BaseColour
ListB.Location = New Point(3, 3)
ListB.Font = New Font("Segoe UI", 8)
ListB.ItemHeight = 20
ListB.Items.Clear()
ListB.IntegralHeight = False
Size = New Size(130, 100)
End Sub
#End Region
End Class
#End Region
#Region "Properties"
<Category("Control")>
Public Property TitleFont As Font
Get
Return _TitleFont
End Get
Set(value As Font)
_TitleFont = value
End Set
End Property
<Category("Control")> _
Public Property Items As String()
Get
Return _Items
End Get
Set(value As String())
_Items = value
ListB.Items.Clear()
ListB.Items.AddRange(value)
Invalidate()
End Set
End Property
<Category("Colours")> _
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")> _
Public Property SelectedColour As Color
Get
Return _SelectedColour
End Get
Set(value As Color)
_SelectedColour = value
End Set
End Property
<Category("Colours")> _
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")> _
Public Property ListBaseColour As Color
Get
Return _ListBaseColour
End Get
Set(value As Color)
_ListBaseColour = value
End Set
End Property
<Category("Colours")> _
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer,
True)
DoubleBuffered = True
ListB.DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
ListB.ScrollAlwaysVisible = False
ListB.HorizontalScrollbar = False
ListB.BorderStyle = BorderStyle.None
ListB.BackColor = BaseColour
ListB.Location = New Point(3, 28)
ListB.Font = New Font("Segoe UI", 8)
ListB.ItemHeight = 20
ListB.Items.Clear()
ListB.IntegralHeight = False
Size = New Size(130, 100)
End Sub
#End Region
End Class
#Region "Declarations"
#End Region
#Region "Properties"
#End Region
Sub New()
Renderer = New ToolStripProfessionalRenderer(New LogInColourTable())
ShowCheckMargin = False
ShowImageMargin = False
ForeColor = Color.FromArgb(255, 255, 255)
End Sub
#End Region
End Class
#Region "Declarations"
Private _ProgressColour As Color = Color.FromArgb(0, 160, 199)
Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
Private _FontColour As Color = Color.FromArgb(50, 50, 50)
Private _SecondColour As Color = Color.FromArgb(0, 145, 184)
Private _Value As Integer = 0
Private _Maximum As Integer = 100
Private _TwoColour As Boolean = True
#End Region
#Region "Properties"
<Category("Control")>
Public Property TwoColour As Boolean
Get
Return _TwoColour
End Get
Set(value As Boolean)
_TwoColour = value
End Set
End Property
<Category("Control")>
Public Property Maximum() As Integer
Get
Return _Maximum
End Get
Set(V As Integer)
Select Case V
Case Is < _Value
_Value = V
End Select
_Maximum = V
Invalidate()
End Set
End Property
<Category("Control")>
Public Property Value() As Integer
Get
Select Case _Value
Case 0
Return 0
Invalidate()
Case Else
Return _Value
Invalidate()
End Select
End Get
Set(V As Integer)
Select Case V
Case Is > _Maximum
V = _Maximum
Invalidate()
End Select
_Value = V
Invalidate()
End Set
End Property
<Category("Colours")>
Public Property ProgressColour As Color
Get
Return _ProgressColour
End Get
Set(value As Color)
_ProgressColour = value
End Set
End Property
<Category("Colours")>
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")>
Public Property FontColour As Color
Get
Return _FontColour
End Get
Set(value As Color)
_FontColour = value
End Set
End Property
#End Region
#Region "Events"
#End Region
#End Region
End Class
#Region "Declarations"
Private WithEvents TB As New RichTextBox
Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
Private _TextColour As Color = Color.FromArgb(255, 255, 255)
Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
#End Region
#Region "Properties"
<Category("Colours")>
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")>
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
#End Region
#Region "Events"
#End Region
Sub New()
With TB
.Multiline = True
.BackColor = _BaseColour
.ForeColor = _TextColour
.Text = String.Empty
.BorderStyle = BorderStyle.None
.Location = New Point(5, 5)
.Font = New Font("Segeo UI", 9)
.Size = New Size(Width - 10, Height - 10)
End With
Controls.Add(TB)
Size = New Size(135, 35)
DoubleBuffered = True
End Sub
#End Region
End Class
#Region "Variables"
Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
Private _TextColour As Color = Color.White
Private _RectColour As Color = Color.FromArgb(21, 117, 149)
Private _ShowLine As Boolean = True
Private _LinesToShow As LinesCount = LinesCount.One
Private _Alignment As Alignments = Alignments.Left
Private _ShowBorder As Boolean = True
#End Region
#Region "Properties"
<Category("Colours")>
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")>
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
Enum Alignments
Left
Center
Right
End Enum
<Category("Control")>
Public Property Alignment As Alignments
Get
Return _Alignment
End Get
Set(value As Alignments)
_Alignment = value
End Set
End Property
<Category("Control")>
Public Property LinesToShow As LinesCount
Get
Return _LinesToShow
End Get
Set(value As LinesCount)
_LinesToShow = value
End Set
End Property
<Category("Colours")> _
Public Property RectangleColor As Color
Get
Return _RectColour
End Get
Set(value As Color)
_RectColour = value
End Set
End Property
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer,
True)
DoubleBuffered = True
Font = New Font("Segoe UI", 9)
ForeColor = Color.White
Size = New Size(Width, 20)
End Sub
#End Region
End Class
<DefaultEvent("ToggleChanged")>
Public Class LogInOnOffSwitch
Inherits Control
#Region "Declarations"
#End Region
<Category("Colours")>
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
Invalidate()
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
Invalidate()
End Set
End Property
<Category("Colours")>
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
Invalidate()
End Set
End Property
<Category("Colours")>
Public Property NonToggledTextColourderColour As Color
Get
Return _NonToggledTextColour
End Get
Set(value As Color)
_NonToggledTextColour = value
Invalidate()
End Set
End Property
<Category("Colours")>
Public Property ToggledColour As Color
Get
Return _ToggledColour
End Get
Set(value As Color)
_ToggledColour = value
Invalidate()
End Set
End Property
Enum Toggles
Toggled
NotToggled
End Enum
Event ToggledChanged()
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw
Or _
ControlStyles.UserPaint Or ControlStyles.DoubleBuffer, True)
BackColor = Color.FromArgb(54, 54, 54)
End Sub
End With
End Sub
#End Region
End Class
Public Class LogInComboBox
Inherits ComboBox
#Region "Declarations"
Private _StartIndex As Integer = 0
Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
Private _BaseColour As Color = Color.FromArgb(42, 42, 42)
Private _FontColour As Color = Color.FromArgb(255, 255, 255)
Private _LineColour As Color = Color.FromArgb(23, 119, 151)
Private _SqaureColour As Color = Color.FromArgb(47, 47, 47)
Private _ArrowColour As Color = Color.FromArgb(30, 30, 30)
Private _SqaureHoverColour As Color = Color.FromArgb(52, 52, 52)
Private State As MouseState = MouseState.None
#End Region
<Category("Colours")>
Public Property LineColour As Color
Get
Return _LineColour
End Get
Set(value As Color)
_LineColour = value
End Set
End Property
<Category("Colours")>
Public Property SqaureColour As Color
Get
Return _SqaureColour
End Get
Set(value As Color)
_SqaureColour = value
End Set
End Property
<Category("Colours")>
Public Property ArrowColour As Color
Get
Return _ArrowColour
End Get
Set(value As Color)
_ArrowColour = value
End Set
End Property
<Category("Colours")>
Public Property SqaureHoverColour As Color
Get
Return _SqaureHoverColour
End Get
Set(value As Color)
_SqaureHoverColour = value
End Set
End Property
<Category("Colours")>
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")>
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")>
Public Property FontColour As Color
Get
Return _FontColour
End Get
Set(value As Color)
_FontColour = value
End Set
End Property
#End Region
End Sub
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer Or
_
ControlStyles.SupportsTransparentBackColor, True)
DoubleBuffered = True
BackColor = Color.Transparent
DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
DropDownStyle = ComboBoxStyle.DropDownList
Width = 163
Font = New Font("Segoe UI", 10)
End Sub
End Sub
#End Region
End Class
#Region "Declarations"
#End Region
#Region "Properties"
<Category("Colours")> _
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")> _
Public Property UpLineColour As Color
Get
Return _UpLineColour
End Get
Set(value As Color)
_UpLineColour = value
End Set
End Property
<Category("Colours")> _
Public Property HorizontalLineColour As Color
Get
Return _HorizLineColour
End Get
Set(value As Color)
_HorizLineColour = value
End Set
End Property
<Category("Colours")> _
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
<Category("Colours")> _
Public Property BackTabColour As Color
Get
Return _BackTabColour
End Get
Set(value As Color)
_BackTabColour = value
End Set
End Property
<Category("Colours")> _
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")> _
Public Property ActiveColour As Color
Get
Return _ActiveColour
End Get
Set(value As Color)
_ActiveColour = value
End Set
End Property
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer,
True)
DoubleBuffered = True
Font = New Font("Segoe UI", 10)
SizeMode = TabSizeMode.Normal
ItemSize = New Size(240, 32)
End Sub
#End Region
End Class
#Region "Declaration"
Private _Maximum As Integer = 10
Private _Value As Integer = 0
Private CaptureMovement As Boolean = False
Private Bar As Rectangle = New Rectangle(0, 10, Width - 21, Height - 21)
Private Track As Size = New Size(25, 14)
Private _TextColour As Color = Color.FromArgb(255, 255, 255)
Private _BorderColour As Color = Color.FromArgb(35, 35, 35)
Private _BarBaseColour As Color = Color.FromArgb(47, 47, 47)
Private _StripColour As Color = Color.FromArgb(42, 42, 42)
Private _StripAmountColour As Color = Color.FromArgb(23, 119, 151)
#End Region
#Region "Properties"
<Category("Colours")> _
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<Category("Colours")> _
Public Property BarBaseColour As Color
Get
Return _BarBaseColour
End Get
Set(value As Color)
_BarBaseColour = value
End Set
End Property
<Category("Colours")> _
Public Property StripColour As Color
Get
Return _StripColour
End Get
Set(value As Color)
_StripColour = value
End Set
End Property
<Category("Colours")> _
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
<Category("Colours")> _
Public Property StripAmountColour As Color
Get
Return _StripAmountColour
End Get
Set(value As Color)
_StripAmountColour = value
End Set
End Property
Event ValueChanged()
#End Region
Sub New()
SetStyle(ControlStyles.OptimizedDoubleBuffer Or
ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
ControlStyles.UserPaint Or ControlStyles.Selectable Or _
ControlStyles.SupportsTransparentBackColor, True)
DoubleBuffered = True
BackColor = Color.FromArgb(54, 54, 54)
End Sub
End Sub
#End Region
End Class
<DefaultEvent("Scroll")>
Public Class LogInVerticalScrollBar
Inherits Control
#Region "Declarations"
#End Region
<Category("Colours")> _
Public Property ThumbBorder As Color
Get
Return _ThumbBorder
End Get
Set(value As Color)
_ThumbBorder = value
End Set
End Property
<Category("Colours")> _
Public Property LineColour As Color
Get
Return _LineColour
End Get
Set(value As Color)
_LineColour = value
End Set
End Property
<Category("Colours")> _
Public Property ArrowColour As Color
Get
Return _ArrowColour
End Get
Set(value As Color)
_ArrowColour = value
End Set
End Property
<Category("Colours")> _
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")> _
Public Property ThumbColour As Color
Get
Return _ThumbColour
End Get
Set(value As Color)
_ThumbColour = value
End Set
End Property
<Category("Colours")> _
Public Property ThumbSecondBorder As Color
Get
Return _ThumbSecondBorder
End Get
Set(value As Color)
_ThumbSecondBorder = value
End Set
End Property
<Category("Colours")> _
Public Property FirstBorder As Color
Get
Return _FirstBorder
End Get
Set(value As Color)
_FirstBorder = value
End Set
End Property
<Category("Colours")> _
Public Property SecondBorder As Color
Get
Return _SecondBorder
End Get
Set(value As Color)
_SecondBorder = value
End Set
End Property
#End Region
Sub New()
SetStyle(ControlStyles.OptimizedDoubleBuffer Or
ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
ControlStyles.UserPaint Or ControlStyles.Selectable Or
_
ControlStyles.SupportsTransparentBackColor, True)
DoubleBuffered = True
Size = New Size(24, 50)
End Sub
End Sub
#End Region
End Class
<DefaultEvent("Scroll")> _
Public Class LogInHorizontalScrollBar
Inherits Control
#Region "Declarations"
#End Region
<Category("Colours")> _
Public Property ThumbBorder As Color
Get
Return _ThumbBorder
End Get
Set(value As Color)
_ThumbBorder = value
End Set
End Property
<Category("Colours")> _
Public Property LineColour As Color
Get
Return _LineColour
End Get
Set(value As Color)
_LineColour = value
End Set
End Property
<Category("Colours")> _
Public Property ArrowColour As Color
Get
Return _ArrowColour
End Get
Set(value As Color)
_ArrowColour = value
End Set
End Property
<Category("Colours")> _
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")> _
Public Property ThumbColour As Color
Get
Return _ThumbColour
End Get
Set(value As Color)
_ThumbColour = value
End Set
End Property
<Category("Colours")> _
Public Property ThumbSecondBorder As Color
Get
Return _ThumbSecondBorder
End Get
Set(value As Color)
_ThumbSecondBorder = value
End Set
End Property
<Category("Colours")> _
Public Property FirstBorder As Color
Get
Return _FirstBorder
End Get
Set(value As Color)
_FirstBorder = value
End Set
End Property
<Category("Colours")> _
Public Property SecondBorder As Color
Get
Return _SecondBorder
End Get
Set(value As Color)
_SecondBorder = value
End Set
End Property
#End Region
Sub New()
SetStyle(ControlStyles.OptimizedDoubleBuffer Or
ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
ControlStyles.UserPaint Or ControlStyles.Selectable Or _
ControlStyles.SupportsTransparentBackColor, True)
DoubleBuffered = True
Height = 18
End Sub
#End Region
End Class
#Region "Declarations"
#End Region
#Region "Properties"
<Category("Colours")> _
Public Property TitleAreaColour As Color
Get
Return _TitleAreaColour
End Get
Set(value As Color)
_TitleAreaColour = value
End Set
End Property
<Category("Colours")> _
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
<Category("Control")> _
Public Property SelectedHeight As Integer
Get
Return _SelectedHeight
End Get
Set(value As Integer)
If value < 1 Then
_SelectedHeight = Height
Else
_SelectedHeight = value
End If
InvalidateScroll()
End Set
End Property
<Category("Colours")> _
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")> _
Public Property SelectedItemColour As Color
Get
Return _SelectedItemColour
End Get
Set(value As Color)
_SelectedItemColour = value
End Set
End Property
<Category("Colours")> _
Public Property NonSelectedItemColour As Color
Get
Return _NonSelectedItemColour
End Get
Set(value As Color)
_NonSelectedItemColour = value
End Set
End Property
<Category("Colours")> _
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentMod
el.DesignerSerializationVisibility.Content)> _
Public Property Items() As LogInListBoxItem()
Get
Return _Items.ToArray()
End Get
Set(ByVal value As LogInListBoxItem())
_Items = New List(Of LogInListBoxItem)(value)
Invalidate()
InvalidateScroll()
End Set
End Property
Public ReadOnly Property SelectedItems() As LogInListBoxItem()
Get
Return _SelectedItems.ToArray()
End Get
End Property
Invalidate()
End Set
End Property
End If
MyBase.Font = value
InvalidateLayout()
End Set
End Property
Invalidate()
End If
MyBase.OnMouseDown(e)
End Sub
Protected Overrides Sub OnMouseWheel(ByVal e As MouseEventArgs)
Dim Move As Integer = -((e.Delta *
SystemInformation.MouseWheelScrollLines \ 120) * (2 \ 2))
Dim Value As Integer = Math.Max(Math.Min(VerticalScrollbar.Value + Move,
VerticalScrollbar.Maximum), VerticalScrollbar.Minimum)
VerticalScrollbar.Value = Value
MyBase.OnMouseWheel(e)
End Sub
#End Region
Sub New()
SetStyle(ControlStyles.OptimizedDoubleBuffer Or
ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
ControlStyles.UserPaint Or ControlStyles.Selectable Or _
ControlStyles.SupportsTransparentBackColor, True)
DoubleBuffered = True
VerticalScrollbar = New LogInVerticalScrollBar
VerticalScrollbar.SmallChange = 1
VerticalScrollbar.LargeChange = 1
AddHandler VerticalScrollbar.Scroll, AddressOf HandleScroll
AddHandler VerticalScrollbar.MouseDown, AddressOf Vertical_MouseDown
Controls.Add(VerticalScrollbar)
InvalidateLayout()
End Sub
#End Region
End Class
#Region "Declarations"
#End Region
#Region "Properties"
<Category("Colours")> _
Public Property TextColour As Color
Get
Return _TextColour
End Get
Set(value As Color)
_TextColour = value
End Set
End Property
<Category("Control")> _
Public Property SelectedHeight As Integer
Get
Return _SelectedHeight
End Get
Set(value As Integer)
If value < 1 Then
_SelectedHeight = Height
Else
_SelectedHeight = value
End If
InvalidateScroll()
End Set
End Property
<Category("Colours")> _
Public Property BaseColour As Color
Get
Return _BaseColour
End Get
Set(value As Color)
_BaseColour = value
End Set
End Property
<Category("Colours")> _
Public Property SelectedItemColour As Color
Get
Return _SelectedItemColour
End Get
Set(value As Color)
_SelectedItemColour = value
End Set
End Property
<Category("Colours")> _
Public Property NonSelectedItemColour As Color
Get
Return _NonSelectedItemColour
End Get
Set(value As Color)
_NonSelectedItemColour = value
End Set
End Property
<Category("Colours")> _
Public Property BorderColour As Color
Get
Return _BorderColour
End Get
Set(value As Color)
_BorderColour = value
End Set
End Property
<System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentMod
el.DesignerSerializationVisibility.Content)> _
Public Property Items() As LogInListBoxItem()
Get
Return _Items.ToArray()
End Get
Set(ByVal value As LogInListBoxItem())
_Items = New List(Of LogInListBoxItem)(value)
Invalidate()
InvalidateScroll()
End Set
End Property
End If
MyBase.Font = value
InvalidateLayout()
End Set
End Property
Invalidate()
End If
MyBase.OnMouseDown(e)
End Sub
#End Region
Sub New()
SetStyle(ControlStyles.OptimizedDoubleBuffer Or
ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
ControlStyles.UserPaint Or ControlStyles.Selectable Or _
ControlStyles.SupportsTransparentBackColor, True)
DoubleBuffered = True
VerticalScrollbar = New LogInVerticalScrollBar
VerticalScrollbar._SmallChange = 1
VerticalScrollbar._LargeChange = 1
AddHandler VerticalScrollbar.Scroll, AddressOf HandleScroll
AddHandler VerticalScrollbar.MouseDown, AddressOf Vertical_MouseDown
Controls.Add(VerticalScrollbar)
InvalidateLayout()
End Sub
End Sub
#End Region
End Class
<DefaultEvent("SelectedIndexChanged")> _
Public Class LogInPaginator
Inherits Control
#Region "Declarations"
Private GP1, GP2 As GraphicsPath
Private R1 As Rectangle
#Region "Functions"
Public Function RoundRectangle(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
#End Region
Sub New()
SetStyle(ControlStyles.OptimizedDoubleBuffer Or
ControlStyles.AllPaintingInWmPaint Or ControlStyles.ResizeRedraw Or _
ControlStyles.UserPaint Or ControlStyles.Selectable Or _
ControlStyles.SupportsTransparentBackColor, True)
DoubleBuffered = True
BackColor = Color.FromArgb(54, 54, 54)
Size = New Size(202, 26)
B1 = New SolidBrush(Color.FromArgb(50, 50, 50))
B2 = New SolidBrush(Color.FromArgb(55, 55, 55))
P1 = New Pen(Color.FromArgb(35, 35, 35))
P2 = New Pen(Color.FromArgb(23, 119, 151))
P3 = New Pen(Color.FromArgb(35, 35, 35))
End Sub
#End Region
End Class