Beruflich Dokumente
Kultur Dokumente
Imports System.Drawing.Drawing2D
Imports System.ComponentModel
Imports System.Runtime.InteropServices
Imports System.Drawing.Text
#End Region
#Region " RoundRect "
Module RoundRectangle
Public Function RoundRect(ByVal Rectangle As Rectangle, ByVal Curve As Integer)
As GraphicsPath
Dim GP As GraphicsPath = New GraphicsPath()
Dim EndArcWidth As Integer = Curve * 2
GP.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, EndArcWidth,
EndArcWidth), -180, 90)
GP.AddArc(New Rectangle(Rectangle.Width - EndArcWidth + Rectangle.X,
Rectangle.Y, EndArcWidth, EndArcWidth), -90, 90)
GP.AddArc(New Rectangle(Rectangle.Width - EndArcWidth + Rectangle.X,
Rectangle.Height - EndArcWidth + Rectangle.Y, EndArcWidth, EndArcWidth), 0, 90)
GP.AddArc(New Rectangle(Rectangle.X, Rectangle.Height - EndArcWidth +
Rectangle.Y, EndArcWidth, EndArcWidth), 90, 90)
GP.AddLine(New Point(Rectangle.X, Rectangle.Height - EndArcWidth +
Rectangle.Y), New Point(Rectangle.X, Curve + Rectangle.Y))
Return GP
End Function
#End Region
'|------DO-NOT-REMOVE------|
'
' Creator: HazelDev
' Site : HazelDev.co.nr
' Created: 23.Jul.2014
' Changed: 31.Aug.2014
' Version: 1.2.0
'
'|------DO-NOT-REMOVE------|
#End Region
#Region " Renderer "
' Fill the gap between menu drop-down and owner item
Using B1 As New SolidBrush(Me.ColorTable.DroppedDownItemBackground)
e.Graphics.FillRectangle(B1, e.ConnectedArea)
End Using
End If
End Sub
If e.Item.Selected Then
c = Me.ColorTable.CommonColorTable.CheckedSelectedBackground
Else
c = Me.ColorTable.CommonColorTable.CheckedBackground
End If
If checked Then
drawBorder = True
Else
If e.Item.Pressed Then
drawBorder = True
Using b As New
SolidBrush(Me.ColorTable.CommonColorTable.PressedBackground)
e.Graphics.FillRectangle(b, rect)
End Using
ElseIf e.Item.Selected Then
drawBorder = True
RectDrawing.DrawSelection(e.Graphics,
Me.ColorTable.CommonColorTable, rect)
End If
End If
If drawBorder Then
Using p As New Pen(Me.ColorTable.CommonColorTable.SelectionBorder)
e.Graphics.DrawRectangle(p, rect)
End Using
End If
End Sub
If e.Item.Pressed Then
drawBorder = True
Using b As New
SolidBrush(Me.ColorTable.CommonColorTable.PressedBackground)
e.Graphics.FillRectangle(b, rect)
End Using
ElseIf e.Item.Selected Then
drawBorder = True
RectDrawing.DrawSelection(e.Graphics, Me.ColorTable.CommonColorTable,
rect)
End If
If drawBorder Then
Using p As New Pen(Me.ColorTable.CommonColorTable.SelectionBorder)
e.Graphics.DrawRectangle(p, rect)
End Using
End If
End Sub
If item.DropDownButtonPressed Then
drawBorder = True
drawSeparator = False
Using b As New
SolidBrush(Me.ColorTable.CommonColorTable.PressedBackground)
e.Graphics.FillRectangle(b, borderRect)
End Using
ElseIf item.DropDownButtonSelected Then
drawBorder = True
RectDrawing.DrawSelection(e.Graphics, Me.ColorTable.CommonColorTable,
borderRect)
End If
If item.ButtonPressed Then
Using b As New
SolidBrush(Me.ColorTable.CommonColorTable.PressedBackground)
e.Graphics.FillRectangle(b, btnRect)
End Using
End If
If drawBorder Then
Using p As New Pen(Me.ColorTable.CommonColorTable.SelectionBorder)
e.Graphics.DrawRectangle(p, borderRect)
If drawSeparator Then e.Graphics.DrawRectangle(p, btnRect)
End Using
Me.DrawCustomArrow(e.Graphics, item)
End If
End Sub
Me.ColorTable.CommonColorTable.Arrow, _
ArrowDirection.Down)
MyBase.OnRenderArrow(arrowEventArgs)
End Sub
If e.Item.Pressed Then
Using b As New
SolidBrush(Me.ColorTable.CommonColorTable.PressedBackground)
e.Graphics.FillRectangle(b, rect)
End Using
ElseIf e.Item.Selected Then
RectDrawing.DrawSelection(e.Graphics, Me.ColorTable.CommonColorTable,
rect)
Else
Using b As New
SolidBrush(Me.ColorTable.CommonColorTable.OverflowBackground)
e.Graphics.FillRectangle(b, rect)
End Using
End If
' Icon
Dim w As Integer = rect.Width - 1
Dim h As Integer = rect.Height - 1
Dim triangleWidth As Single = w / 2.0F + 1
Dim triangleLeft As Single = rect.Left + (w - triangleWidth) / 2.0F + 3
Dim triangleHeight As Single = triangleWidth / 2.0F
Dim triangleTop As Single = rect.Top + (h - triangleHeight) / 2.0F + 7
Dim arrowRect As New RectangleF(triangleLeft, triangleTop, triangleWidth,
triangleHeight)
Me.DrawCustomArrow(e.Graphics, e.Item, Rectangle.Round(arrowRect))
#End Region
#Region " Drawing "
TopRect = FillRect
TopRect.Height -= CInt(TopRect.Height / 2)
BottomRect = New Rectangle(TopRect.X, TopRect.Bottom, TopRect.Width,
FillRect.Height - TopRect.Height)
' Top gradient
Using LGB As New LinearGradientBrush(TopRect,
ColorTable.SelectionTopGradient, ColorTable.SelectionMidGradient,
LinearGradientMode.Vertical)
G.FillRectangle(LGB, TopRect)
End Using
' Bottom
Using B1 As New SolidBrush(ColorTable.SelectionBottomGradient)
G.FillRectangle(B1, BottomRect)
End Using
' Border
Using P1 As New Pen(ColorTable.SelectionBorder)
RectDrawing.DrawRoundedRectangle(G, P1, Rect.X, Rect.Y, Rect.Width,
Rect.Height, 2)
End Using
End Sub
G.SmoothingMode = SmoothingMode.AntiAlias
G.DrawPath(P, gp)
G.SmoothingMode = SmoothingMode.Default
End Using
End Sub
End Class
#End Region
#End Region
#Region " ThemeContainer "
#End Region
#Region " Properties "
#End Region
#Region " EventArgs "
#End Region
Protected Overrides Sub OnCreateControl()
MyBase.OnCreateControl()
Me.ParentForm.FormBorderStyle = FormBorderStyle.None
Me.ParentForm.TransparencyKey = Color.Fuchsia
End Sub
Sub New()
MyBase.New()
SetStyle(DirectCast(139270, ControlStyles), True)
Dock = DockStyle.Fill
MoveHeight = 25
Padding = New Padding(5, 28, 5, 29)
Font = New Font("Segoe UI", 8, FontStyle.Regular)
ForeColor = Color.FromArgb(142, 142, 142)
BackColor = Color.FromArgb(246, 246, 246)
DoubleBuffered = True
End Sub
G.SmoothingMode = SmoothingMode.Default
G.Clear(TransparencyKey)
' Patch the header with a rectangle that has a curve so its border will
remain within container bounds
G.FillPath(New SolidBrush(Color.FromArgb(52, 52, 52)),
RoundRectangle.RoundRect(New Rectangle(2, 2, Width / 2 + 2, 16), BorderCurve))
G.FillPath(New SolidBrush(Color.FromArgb(52, 52, 52)),
RoundRectangle.RoundRect(New Rectangle(Width / 2 - 3, 2, Width / 2, 16),
BorderCurve))
' Fill the header rectangle below the patch
G.FillRectangle(New SolidBrush(Color.FromArgb(52, 52, 52)), New
Rectangle(2, 15, Width - 5, 10))
e.Graphics.DrawImage(B.Clone(), 0, 0)
G.Dispose()
B.Dispose()
End Sub
End Class
#End Region
#Region " ControlBox "
#End Region
#Region " Variables "
#End Region
#Region " EventArgs "
#End Region
Sub New()
SetStyle(ControlStyles.SupportsTransparentBackColor Or
ControlStyles.UserPaint, True)
BackColor = Color.Transparent
DoubleBuffered = True
Anchor = AnchorStyles.Top Or AnchorStyles.Right
End Sub
Protected Overrides Sub OnCreateControl()
MyBase.OnCreateControl()
Location = New Point(FindForm.Width - 81, -1) ' Auto-decide control
location on the theme container
End Sub
e.Graphics.DrawImage(B.Clone(), 0, 0)
G.Dispose()
GP_CloseRect.Dispose()
GP_MinimizeRect.Dispose()
B.Dispose()
End Sub
End Class
#End Region
#Region " Button 1 "
Class iTalk_Button_1
Inherits Control
#End Region
#Region " Image Designer "
End Select
#End Region
#Region " Properties "
_Image = value
Invalidate()
End Set
End Property
#End Region
#Region " EventArgs "
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or _
ControlStyles.OptimizedDoubleBuffer Or _
ControlStyles.ResizeRedraw Or _
ControlStyles.SupportsTransparentBackColor Or _
ControlStyles.UserPaint, True)
BackColor = Color.Transparent
DoubleBuffered = True
Font = New Font("Segoe UI", 12)
ForeColor = Color.FromArgb(150, 150, 150)
Size = New Size(166, 40)
_TextAlignment = StringAlignment.Center
P1 = New Pen(Color.FromArgb(190, 190, 190)) ' P1 = Border color
End Sub
P3 = New Pen(PressedContourGB)
End If
With Shape
.AddArc(0, 0, 10, 10, 180, 90)
.AddArc(Width - 11, 0, 10, 10, -90, 90)
.AddArc(Width - 11, Height - 11, 10, 10, 0, 90)
.AddArc(0, Height - 11, 10, 10, 90, 90)
.CloseAllFigures()
End With
Invalidate()
MyBase.OnResize(e)
End Sub
If IsNothing(Image) Then
' If an image is not specified, only draw the string on the
button
.DrawString(Text, Font, New SolidBrush(ForeColor), R1, New
StringFormat() With {.Alignment = _TextAlignment, .LineAlignment =
StringAlignment.Center})
Else
' If an image is specified, the image and draw the string
on the button
.DrawImage(_Image, ipt.X, ipt.Y, ImageSize.Width,
ImageSize.Height)
.DrawString(Text, Font, New SolidBrush(ForeColor), R1, New
StringFormat() With {.Alignment = _TextAlignment, .LineAlignment =
StringAlignment.Center})
End If
End Select
End With
MyBase.OnPaint(e)
End Sub
End Class
#End Region
#Region " Button 2 "
Class iTalk_Button_2
Inherits Control
#End Region
#Region " Image Designer "
#End Region
#Region " Properties "
_Image = value
Invalidate()
End Set
End Property
#End Region
#Region " EventArgs "
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or _
ControlStyles.OptimizedDoubleBuffer Or _
ControlStyles.ResizeRedraw Or _
ControlStyles.SupportsTransparentBackColor Or _
ControlStyles.UserPaint, True)
BackColor = Color.Transparent
DoubleBuffered = True
Font = New Font("Segoe UI", 14)
ForeColor = Color.White
Size = New Size(166, 40)
_TextAlignment = StringAlignment.Center
P1 = New Pen(Color.FromArgb(0, 118, 176)) ' P1 = Border color
End Sub
P3 = New Pen(PressedContourGB)
End If
With Shape
.AddArc(0, 0, 10, 10, 180, 90)
.AddArc(Width - 11, 0, 10, 10, -90, 90)
.AddArc(Width - 11, Height - 11, 10, 10, 0, 90)
.AddArc(0, Height - 11, 10, 10, 90, 90)
.CloseAllFigures()
End With
Invalidate()
MyBase.OnResize(e)
End Sub
#End Region
#Region " Label "
Class iTalk_Label
Inherits Label
Sub New()
Font = New Font("Segoe UI", 8)
ForeColor = Color.FromArgb(142, 142, 142)
BackColor = Color.Transparent
End Sub
End Class
#End Region
#Region " Link Label "
Class iTalk_LinkLabel
Inherits LinkLabel
Sub New()
Font = New Font("Segoe UI", 8, FontStyle.Regular)
BackColor = Color.Transparent
LinkColor = Color.FromArgb(51, 153, 225)
ActiveLinkColor = Color.FromArgb(0, 101, 202)
VisitedLinkColor = Color.FromArgb(0, 101, 202)
LinkBehavior = Windows.Forms.LinkBehavior.NeverUnderline
End Sub
End Class
#End Region
#Region " Header Label "
Class iTalk_HeaderLabel
Inherits Label
Sub New()
Font = New Font("Segoe UI", 25, FontStyle.Regular)
ForeColor = Color.FromArgb(80, 80, 80)
BackColor = Color.Transparent
End Sub
End Class
#End Region
#Region " Toggle Button "
'|------DO-NOT-REMOVE------|
'|---------CREDITS---------|
'|---------CREDITS---------|
'|------DO-NOT-REMOVE------|
Class PillStyle
Public Left As Boolean
Public Right As Boolean
End Class
If PillStyle.Left Then
Pill.AddArc(New Rectangle(Rectangle.X, Rectangle.Y, Rectangle.Height,
Rectangle.Height), -270, 180)
Else
Pill.AddLine(Rectangle.X, Rectangle.Y + Rectangle.Height, Rectangle.X,
Rectangle.Y)
End If
If PillStyle.Right Then
Pill.AddArc(New Rectangle(Rectangle.X + Rectangle.Width -
Rectangle.Height, Rectangle.Y, Rectangle.Height, Rectangle.Height), -90, 180)
Else
Pill.AddLine(Rectangle.X + Rectangle.Width, Rectangle.Y, Rectangle.X +
Rectangle.Width, Rectangle.Y + Rectangle.Height)
End If
Pill.CloseAllFigures()
Return Pill
End Function
#End Region
#Region " Enums "
Enum _Type
YesNo
OnOff
IO
End Enum
#End Region
#Region " Variables "
#End Region
#Region " Properties "
#End Region
#Region " EventArgs "
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or _
ControlStyles.DoubleBuffer Or _
ControlStyles.ResizeRedraw Or _
ControlStyles.UserPaint, True)
End Sub
Protected Overrides Sub OnHandleCreated(e As EventArgs)
MyBase.OnHandleCreated(e)
AnimationTimer.Start() ' activate the animation timer
End Sub
G.Clear(Parent.BackColor)
G.SmoothingMode = SmoothingMode.AntiAlias
' Draw the control body and border
G.FillPath(Gradient, Pill(0, CInt(Height / 2 - cHandle.Height / 2), Width -
1, cHandle.Height - 5, New PillStyle With {.Left = True, .Right = True}))
G.DrawPath(New Pen(Color.FromArgb(177, 177, 176)), Pill(0, CInt(Height / 2
- cHandle.Height / 2), Width - 1, cHandle.Height - 5, New PillStyle With {.Left =
True, .Right = True}))
#End Region
#Region " Big TextBox "
#End Region
#Region " Properties "
If value Then
iTalkTB.Height = Height - 23
Else
Height = iTalkTB.Height + 23
End If
End If
End Set
End Property
#End Region
#Region " EventArgs "
#End Region
Sub AddTextBox()
With iTalkTB
.Size = New Size(Width - 10, 43)
.Location = New Point(7, 10)
.Text = String.Empty
.BorderStyle = BorderStyle.None
.TextAlign = HorizontalAlignment.Left
.Font = New Font("Tahoma", 11)
.UseSystemPasswordChar = UseSystemPasswordChar
.Multiline = False
End With
AddHandler iTalkTB.KeyDown, AddressOf _OnKeyDown
End Sub
Sub New()
SetStyle(ControlStyles.SupportsTransparentBackColor, True)
SetStyle(ControlStyles.UserPaint, True)
AddTextBox()
Controls.Add(iTalkTB)
Text = Nothing
Font = New Font("Tahoma", 11)
Size = New Size(135, 43)
DoubleBuffered = True
End Sub
G.SmoothingMode = SmoothingMode.AntiAlias
With iTalkTB
.Width = Width - 10
.TextAlign = TextAlignment
.UseSystemPasswordChar = UseSystemPasswordChar
End With
G.Clear(Color.Transparent)
G.FillPath(B1, Shape) ' Draw background
G.DrawPath(P1, Shape) ' Draw border
e.Graphics.DrawImage(B.Clone(), 0, 0)
G.Dispose() : B.Dispose()
End Sub
End Class
#End Region
#Region " Small TextBox "
#End Region
#Region " Properties "
If value Then
iTalkTB.Height = Height - 10
Else
Height = iTalkTB.Height + 10
End If
End If
End Set
End Property
#End Region
#Region " EventArgs "
#End Region
Sub AddTextBox()
' Initialize the TextBox
With iTalkTB
.Size = New Size(Width - 10, 33)
.Location = New Point(7, 5)
.Text = String.Empty
.BorderStyle = BorderStyle.None
.TextAlign = HorizontalAlignment.Left
.Font = New Font("Tahoma", 9)
.UseSystemPasswordChar = UseSystemPasswordChar
.Multiline = False
End With
AddHandler iTalkTB.KeyDown, AddressOf _OnKeyDown
End Sub
Sub New()
SetStyle(ControlStyles.SupportsTransparentBackColor, True)
SetStyle(ControlStyles.UserPaint, True)
AddTextBox()
Controls.Add(iTalkTB)
Text = Nothing
Font = New Font("Tahoma", 11)
Size = New Size(135, 33)
DoubleBuffered = True
End Sub
G.SmoothingMode = SmoothingMode.AntiAlias
With iTalkTB
.Width = Width - 10
.TextAlign = TextAlignment
.UseSystemPasswordChar = UseSystemPasswordChar
End With
G.Clear(Color.Transparent)
G.FillPath(B1, Shape) ' Draw background
G.DrawPath(P1, Shape) ' Draw border
e.Graphics.DrawImage(B.Clone(), 0, 0)
G.Dispose() : B.Dispose()
End Sub
End Class
#End Region
#Region " RichTextBox "
#End Region
#Region " Properties "
#End Region
Sub AddRichTextBox()
With iTalkRTB
.BackColor = Color.White
.Size = New Size(Width - 10, 100)
.Location = New Point(7, 5)
.Text = String.Empty
.BorderStyle = BorderStyle.None
.Font = New Font("Tahoma", 10)
.Multiline = True
End With
End Sub
Sub New()
MyBase.New()
SetStyle(ControlStyles.SupportsTransparentBackColor, True)
SetStyle(ControlStyles.UserPaint, True)
AddRichTextBox()
Controls.Add(iTalkRTB)
BackColor = Color.Transparent
ForeColor = Color.DimGray
Text = Nothing
Font = New Font("Tahoma", 10)
Size = New Size(150, 100)
WordWrap = True
AutoWordSelection = False
DoubleBuffered = True
End Sub
G.SmoothingMode = SmoothingMode.AntiAlias
G.Dispose()
e.Graphics.DrawImage(B.Clone(), 0, 0)
B.Dispose()
End Sub
End Class
#End Region
#Region " NumericUpDown "
Class iTalk_NumericUpDown
Inherits Control
Enum _TextAlignment
Near
Center
End Enum
#End Region
#Region " Variables "
#End Region
#Region " Properties "
#End Region
#Region " EventArgs "
#End Region
Sub New()
SetStyle(ControlStyles.SupportsTransparentBackColor, True)
SetStyle(ControlStyles.UserPaint, True)
_Minimum = 0
_Maximum = 100
G.SmoothingMode = SmoothingMode.AntiAlias
#End Region
#Region " Left Chat Bubble "
#End Region
#Region " Properties "
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or _
ControlStyles.OptimizedDoubleBuffer Or _
ControlStyles.ResizeRedraw Or _
ControlStyles.SupportsTransparentBackColor Or _
ControlStyles.UserPaint, True)
DoubleBuffered = True
Size = New Size(152, 38)
BackColor = Color.Transparent
ForeColor = Color.FromArgb(52, 52, 52)
Font = New Font("Segoe UI", 10)
End Sub
With Shape
.AddArc(9, 0, 10, 10, 180, 90)
.AddArc(Width - 11, 0, 10, 10, -90, 90)
.AddArc(Width - 11, Height - 11, 10, 10, 0, 90)
.AddArc(9, Height - 11, 10, 10, 90, 90)
.CloseAllFigures()
End With
Invalidate()
MyBase.OnResize(e)
End Sub
With G
.SmoothingMode = SmoothingMode.HighQuality
.PixelOffsetMode = PixelOffsetMode.HighQuality
.Clear(BackColor)
G.Dispose()
e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic
e.Graphics.DrawImageUnscaled(B, 0, 0)
B.Dispose()
End Sub
End Class
#End Region
#Region " Right Chat Bubble "
#End Region
#Region " Properties "
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or _
ControlStyles.OptimizedDoubleBuffer Or _
ControlStyles.ResizeRedraw Or _
ControlStyles.SupportsTransparentBackColor Or _
ControlStyles.UserPaint, True)
DoubleBuffered = True
Size = New Size(152, 38)
BackColor = Color.Transparent
ForeColor = Color.FromArgb(52, 52, 52)
Font = New Font("Segoe UI", 10)
End Sub
Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
MyBase.OnResize(e)
Shape = New GraphicsPath
With Shape
.AddArc(0, 0, 10, 10, 180, 90)
.AddArc(Width - 18, 0, 10, 10, -90, 90)
.AddArc(Width - 18, Height - 11, 10, 10, 0, 90)
.AddArc(0, Height - 11, 10, 10, 90, 90)
.CloseAllFigures()
End With
Invalidate()
End Sub
With G
.SmoothingMode = SmoothingMode.HighQuality
.PixelOffsetMode = PixelOffsetMode.HighQuality
.Clear(BackColor)
#End Region
#Region " Separator "
#End Region
Sub New()
SetStyle(ControlStyles.ResizeRedraw, True)
Me.Size = New Point(120, 10)
End Sub
#End Region
#Region " Panel "
Class iTalk_Panel
Inherits ContainerControl
Sub New()
SetStyle(ControlStyles.SupportsTransparentBackColor, True)
SetStyle(ControlStyles.UserPaint, True)
BackColor = Color.Transparent
Me.Size = New Size(187, 117)
Padding = New Padding(5, 5, 5, 5)
DoubleBuffered = True
End Sub
G.SmoothingMode = SmoothingMode.HighQuality
G.Dispose()
e.Graphics.DrawImage(B.Clone(), 0, 0)
B.Dispose()
End Sub
End Class
#End Region
#Region " GroupBox "
Sub New()
SetStyle(ControlStyles.UserPaint Or
ControlStyles.SupportsTransparentBackColor, True)
BackColor = Color.Transparent
DoubleBuffered = True ' Reduce control flicker
Me.Size = New Size(212, 104)
Me.MinimumSize = New Size(136, 50)
Me.Padding = New Padding(5, 28, 5, 5) ' Set padding so controls won't
overlay when full-docked
End Sub
G.Clear(Color.Transparent)
G.SmoothingMode = SmoothingMode.HighQuality ' Specifies antialiased
rendering
e.Graphics.DrawImage(B.Clone(), 0, 0)
G.Dispose()
B.Dispose()
End Sub
End Class
#End Region
#Region " CheckBox "
#End Region
#Region " Properties "
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or _
ControlStyles.OptimizedDoubleBuffer Or _
ControlStyles.ResizeRedraw Or _
ControlStyles.SupportsTransparentBackColor Or _
ControlStyles.UserPaint, True)
BackColor = Color.Transparent
DoubleBuffered = True ' Reduce control flicker
Font = New Font("Segoe UI", 10)
Size = New Size(120, 26)
End Sub
With Shape
.AddArc(0, 0, 7, 7, 180, 90)
.AddArc(7, 0, 7, 7, -90, 90)
.AddArc(7, 7, 7, 7, 0, 90)
.AddArc(0, 7, 7, 7, 90, 90)
.CloseAllFigures()
End With
Height = 15
End If
Invalidate()
MyBase.OnResize(e)
End Sub
With e.Graphics
.Clear(Color.FromArgb(246, 246, 246))
.SmoothingMode = SmoothingMode.AntiAlias
If Checked Then
.DrawString("�", New Font("Wingdings", 14), New
SolidBrush(Color.FromArgb(142, 142, 142)), New Rectangle(-2, 1, Width, Height), New
StringFormat() With {.LineAlignment = StringAlignment.Center})
End If
End With
e.Dispose()
End Sub
End Class
#End Region
#Region " RadioButton "
#End Region
#Region " Variables "
#End Region
#Region " Properties "
Property Checked() As Boolean
Get
Return _Checked
End Get
Set(ByVal value As Boolean)
_Checked = value
InvalidateControls()
RaiseEvent CheckedChanged(Me)
Invalidate()
End Set
End Property
#End Region
#Region " EventArgs "
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or _
ControlStyles.OptimizedDoubleBuffer Or _
ControlStyles.ResizeRedraw Or _
ControlStyles.SupportsTransparentBackColor Or _
ControlStyles.UserPaint, True)
BackColor = Color.Transparent
Font = New Font("Segoe UI", 10)
Width = 132
End Sub
#End Region
#Region " Notification Number "
Class iTalk_NotificationNumber
Inherits Control
#End Region
#Region " Properties "
#End Region
Sub New()
SetStyle(ControlStyles.SupportsTransparentBackColor, True)
SetStyle(ControlStyles.UserPaint, True)
Text = Nothing
DoubleBuffered = True
End Sub
#End Region
#Region " ListView "
Class iTalk_Listview
Inherits ListView
<DllImport("uxtheme", CharSet:=CharSet.Unicode)> _
Public Shared Function SetWindowTheme(ByVal hWnd As IntPtr, ByVal
textSubAppName As String, ByVal textSubIdList As String) As Integer
End Function
#End Region
#Region " ComboBox "
Class iTalk_ComboBox
Inherits ComboBox
#End Region
#Region " Custom Properties "
#End Region
#Region " EventArgs "
#End Region
Sub New()
SetStyle(DirectCast(139286, ControlStyles), True)
SetStyle(ControlStyles.Selectable, False)
DrawMode = Windows.Forms.DrawMode.OwnerDrawFixed
DropDownStyle = ComboBoxStyle.DropDownList
e.Graphics.Clear(BackColor)
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias
e.Graphics.SetClip(GP)
e.Graphics.FillRectangle(LGB, ClientRectangle)
e.Graphics.ResetClip()
GP.Dispose()
LGB.Dispose()
End Sub
End Class
#End Region
#Region " Circular ProgressBar "
Enum _ProgressShape
Round
Flat
End Enum
#End Region
#Region " Variables "
#End Region
#Region " Custom Properties "
#End Region
#Region " EventArgs "
#End Region
Sub New()
Size = New Size(130, 130)
Font = New Font("Segoe UI", 15)
MinimumSize = New Size(100, 100)
DoubleBuffered = True ' Reduce flicker
End Sub
G.SmoothingMode = SmoothingMode.AntiAlias
G.Clear(BackColor)
#End Region
#Region " Progress Indicator "
Class iTalk_ProgressIndicator
Inherits Control
#End Region
#Region " Custom Properties "
#End Region
#Region " EventArgs "
#End Region
_StartingFloatPoint = StartingFloatPoint
Rise = AssignValues(Run, Length)
Rise = Math.Sin(CircleRadian) * Rise
Run = Math.Cos(CircleRadian) * Run
End Sub
#End Region
#Region " TabControl "
Class iTalk_TabControl
Inherits TabControl
' NOTE: For best quality icons/images on the TabControl; from the associated
ImageList, set
' the image size (24,24) so it can fit in the tab rectangle. However, to ensure
a
' high-quality image drawing, make sure you only add (32,32) images and not
(24,24) as
' determined in the ImageList
' INFO: A free, non-commercial icon list that would fit in perfectly with the
TabControl is
' Wireframe Toolbar Icons by Gentleface. Licensed under Creative Commons
Attribution.
' Check it out from here: http://www.gentleface.com/free_icon_set.html
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or _
ControlStyles.UserPaint Or _
ControlStyles.ResizeRedraw Or _
ControlStyles.DoubleBuffer, True)
DoubleBuffered = True
SizeMode = TabSizeMode.Fixed
ItemSize = New Size(44, 135)
DrawMode = TabDrawMode.OwnerDrawFixed
MyBase.DoubleBuffered = True
SizeMode = TabSizeMode.Fixed
Appearance = TabAppearance.Normal
Alignment = TabAlignment.Left
End Sub
With G
.DrawImage(Me.ImageList.Images.Item(TabPages(TabIndex).ImageIndex), TabRect.X + 9,
TabRect.Y + 6, 24, 24)
End If
End If
Else
.DrawImage(Me.ImageList.Images.Item(TabPages(TabIndex).ImageIndex), TabRect.X + 9,
TabRect.Y + 6, 24, 24)
End If
End If
End If
Next
e.Graphics.SmoothingMode = SmoothingMode.HighQuality
e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic
e.Graphics.CompositingQuality = CompositingQuality.HighQuality
e.Graphics.DrawImage(B.Clone, 0, 0)
G.Dispose()
B.Dispose()
End With
End Sub
End Class
#End Region
#Region " TrackBar "
Enum ValueDivisor
By1 = 1
By10 = 10
By100 = 100
By1000 = 1000
End Enum
#End Region
#Region " Variables "
#End Region
#Region " Custom Properties "
_Minimum = value
Invalidate()
End Set
End Property
_Maximum = value
Invalidate()
End Set
End Property
Event ValueChanged()
Public Property Value() As Integer
Get
Return _Value
End Get
Set(ByVal value As Integer)
If _Value <> value Then
If value < _Minimum Then
_Value = _Minimum
Else
If value > _Maximum Then
_Value = _Maximum
Else
_Value = value
End If
End If
Invalidate()
RaiseEvent ValueChanged()
End If
End Set
End Property
#End Region
#Region " EventArgs "
#End Region
Sub New()
SetStyle(ControlStyles.AllPaintingInWmPaint Or _
ControlStyles.UserPaint Or _
ControlStyles.ResizeRedraw Or _
ControlStyles.DoubleBuffer, True)
_DrawHatch = True
Size = New Size(80, 22)
MinimumSize = New Size(37, 22)
End Sub
G.Clear(Parent.BackColor)
G.SmoothingMode = SmoothingMode.AntiAlias
Try
ValueDrawer = CInt((_Value - _Minimum) / (_Maximum - _Minimum) * (Width
- 11))
Catch ex As Exception
End Try
TrackBarHandleRect = New Rectangle(ValueDrawer, 0, 10, 20)
G.FillRectangle(VlaueLGB, ValueRect)
G.SmoothingMode = SmoothingMode.AntiAlias
G.DrawPath(New Pen(Color.FromArgb(180, 180, 180)), PipeBorder) ' Draw pipe
border
TrackBarHandle = RoundRectangle.RoundRect(TrackBarHandleRect, 3)
TrackBarHandleLGB = New LinearGradientBrush(ClientRectangle,
SystemColors.Control, SystemColors.Control, 90.0F)
' Fill the handle body with the specified color gradient
G.FillPath(TrackBarHandleLGB, TrackBarHandle)
' Draw handle borders
G.DrawPath(New Pen(Color.FromArgb(180, 180, 180)), TrackBarHandle)
#End Region
#Region " MenuStrip "
End Class
#End Region
#Region " ContextMenuStrip "
#End Region
#Region " StatusStrip "
#End Region
#Region " Info Icon "
Class iTalk_Icon_Info
Inherits Control
Public Sub New()
Me.ForeColor = Color.DimGray
Me.BackColor = Color.FromArgb(246, 246, 246)
Me.Size = New Size(33, 33)
DoubleBuffered = True
End Sub
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
e.Graphics.SmoothingMode = SmoothingMode.HighQuality
e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit
#End Region
#Region " Tick Icon "
Class iTalk_Icon_Tick
Inherits Control
Sub New()
Me.ForeColor = Color.DimGray
Me.BackColor = Color.FromArgb(246, 246, 246)
Me.Size = New Size(33, 33)
DoubleBuffered = True
End Sub
#End Region