Salut donc se matin je me faisais chier donc je me suis dit: une calculatrice pour montrer mes compétences de programmation ?
C'est une peu juste :( mais c'est déjà sa :)
ET CODAGE:
La class:
Voila donc un screen du rendu :
Ce lien n'est pas visible, veuillez vous connecter pour l'afficher. Je m'inscris!
TÉLÉCHARGEMENT: Ce lien n'est pas visible, veuillez vous connecter pour l'afficher. Je m'inscris!
Voila a +
C'est une peu juste :( mais c'est déjà sa :)
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form remplace la méthode Dispose pour nettoyer la liste des composants.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Requise par le Concepteur Windows Form
Private components As System.ComponentModel.IContainer
'REMARQUE*: la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée à l'aide du Concepteur Windows Form.
'Ne la modifiez pas à l'aide de l'éditeur de code.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
Me.TXT_2 = New System.Windows.Forms.TextBox
Me.TXT_1 = New System.Windows.Forms.TextBox
Me.TXT_EGALE = New System.Windows.Forms.TextBox
Me.CypherxButton14 = New Calculatrice.CypherxButton
Me.CypherxButton13 = New Calculatrice.CypherxButton
Me.CypherxButton12 = New Calculatrice.CypherxButton
Me.CypherxButton11 = New Calculatrice.CypherxButton
Me.CypherxLabel1 = New Calculatrice.CypherxLabel
Me.CyperxSeperator2 = New Calculatrice.CyperxSeperator
Me.CyperxSeperator1 = New Calculatrice.CyperxSeperator
Me.moin = New Calculatrice.CypherxButton
Me.fois = New Calculatrice.CypherxButton
Me.diviser = New Calculatrice.CypherxButton
Me.plus = New Calculatrice.CypherxButton
Me.CypherxButton10 = New Calculatrice.CypherxButton
Me.CypherxButton9 = New Calculatrice.CypherxButton
Me.CypherxButton8 = New Calculatrice.CypherxButton
Me.CypherxButton7 = New Calculatrice.CypherxButton
Me.CypherxButton6 = New Calculatrice.CypherxButton
Me.CypherxButton5 = New Calculatrice.CypherxButton
Me.CypherxButton4 = New Calculatrice.CypherxButton
Me.CypherxButton3 = New Calculatrice.CypherxButton
Me.CypherxButton2 = New Calculatrice.CypherxButton
Me.CypherxButton1 = New Calculatrice.CypherxButton
Me.CypherxTheme1 = New Calculatrice.CypherxTheme
Me.SuspendLayout()
'
'TXT_2
'
Me.TXT_2.BackColor = System.Drawing.Color.White
Me.TXT_2.Location = New System.Drawing.Point(129, 65)
Me.TXT_2.Name = "TXT_2"
Me.TXT_2.ReadOnly = True
Me.TXT_2.Size = New System.Drawing.Size(109, 20)
Me.TXT_2.TabIndex = 28
'
'TXT_1
'
Me.TXT_1.BackColor = System.Drawing.Color.White
Me.TXT_1.Location = New System.Drawing.Point(13, 65)
Me.TXT_1.Name = "TXT_1"
Me.TXT_1.ReadOnly = True
Me.TXT_1.Size = New System.Drawing.Size(109, 20)
Me.TXT_1.TabIndex = 29
'
'TXT_EGALE
'
Me.TXT_EGALE.BackColor = System.Drawing.Color.White
Me.TXT_EGALE.Location = New System.Drawing.Point(243, 65)
Me.TXT_EGALE.Name = "TXT_EGALE"
Me.TXT_EGALE.ReadOnly = True
Me.TXT_EGALE.Size = New System.Drawing.Size(100, 20)
Me.TXT_EGALE.TabIndex = 30
'
'CypherxButton14
'
Me.CypherxButton14.FadeInTime = 200
Me.CypherxButton14.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton14.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton14.Location = New System.Drawing.Point(186, 193)
Me.CypherxButton14.Name = "CypherxButton14"
Me.CypherxButton14.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton14.TabIndex = 34
Me.CypherxButton14.Text = "x10"
'
'CypherxButton13
'
Me.CypherxButton13.FadeInTime = 200
Me.CypherxButton13.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton13.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton13.Location = New System.Drawing.Point(70, 193)
Me.CypherxButton13.Name = "CypherxButton13"
Me.CypherxButton13.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton13.TabIndex = 33
Me.CypherxButton13.Text = "0"
'
'CypherxButton12
'
Me.CypherxButton12.FadeInTime = 200
Me.CypherxButton12.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton12.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton12.Location = New System.Drawing.Point(243, 106)
Me.CypherxButton12.Name = "CypherxButton12"
Me.CypherxButton12.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton12.TabIndex = 32
Me.CypherxButton12.Text = "CE"
'
'CypherxButton11
'
Me.CypherxButton11.FadeInTime = 200
Me.CypherxButton11.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton11.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton11.Location = New System.Drawing.Point(301, 106)
Me.CypherxButton11.Name = "CypherxButton11"
Me.CypherxButton11.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton11.TabIndex = 31
Me.CypherxButton11.Text = "C"
'
'CypherxLabel1
'
Me.CypherxLabel1.AutoSize = True
Me.CypherxLabel1.BackColor = System.Drawing.Color.Transparent
Me.CypherxLabel1.Font = New System.Drawing.Font("Arial", 8.0!)
Me.CypherxLabel1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxLabel1.Location = New System.Drawing.Point(117, 31)
Me.CypherxLabel1.Name = "CypherxLabel1"
Me.CypherxLabel1.Size = New System.Drawing.Size(131, 14)
Me.CypherxLabel1.TabIndex = 24
Me.CypherxLabel1.Text = "Calculatrice By Bwisingw"
'
'CyperxSeperator2
'
Me.CyperxSeperator2.Location = New System.Drawing.Point(12, 93)
Me.CyperxSeperator2.Name = "CyperxSeperator2"
Me.CyperxSeperator2.Size = New System.Drawing.Size(341, 10)
Me.CyperxSeperator2.Style = Calculatrice.CyperxSeperator.Direction.Horizontal
Me.CyperxSeperator2.TabIndex = 23
Me.CyperxSeperator2.Text = "CyperxSeperator2"
Me.CyperxSeperator2.Thickness = 2
'
'CyperxSeperator1
'
Me.CyperxSeperator1.Location = New System.Drawing.Point(12, 48)
Me.CyperxSeperator1.Name = "CyperxSeperator1"
Me.CyperxSeperator1.Size = New System.Drawing.Size(341, 10)
Me.CyperxSeperator1.Style = Calculatrice.CyperxSeperator.Direction.Horizontal
Me.CyperxSeperator1.TabIndex = 22
Me.CyperxSeperator1.Text = "CyperxSeperator1"
Me.CyperxSeperator1.Thickness = 2
'
'moin
'
Me.moin.FadeInTime = 200
Me.moin.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.moin.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.moin.Location = New System.Drawing.Point(243, 164)
Me.moin.Name = "moin"
Me.moin.Size = New System.Drawing.Size(52, 23)
Me.moin.TabIndex = 15
Me.moin.Text = "-"
'
'fois
'
Me.fois.FadeInTime = 200
Me.fois.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.fois.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.fois.Location = New System.Drawing.Point(186, 135)
Me.fois.Name = "fois"
Me.fois.Size = New System.Drawing.Size(52, 23)
Me.fois.TabIndex = 14
Me.fois.Text = "x"
'
'diviser
'
Me.diviser.FadeInTime = 200
Me.diviser.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.diviser.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.diviser.Location = New System.Drawing.Point(243, 135)
Me.diviser.Name = "diviser"
Me.diviser.Size = New System.Drawing.Size(52, 23)
Me.diviser.TabIndex = 13
Me.diviser.Text = ":"
'
'plus
'
Me.plus.FadeInTime = 200
Me.plus.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.plus.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.plus.Location = New System.Drawing.Point(186, 164)
Me.plus.Name = "plus"
Me.plus.Size = New System.Drawing.Size(52, 23)
Me.plus.TabIndex = 12
Me.plus.Text = "+"
'
'CypherxButton10
'
Me.CypherxButton10.FadeInTime = 200
Me.CypherxButton10.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton10.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton10.Location = New System.Drawing.Point(301, 164)
Me.CypherxButton10.Name = "CypherxButton10"
Me.CypherxButton10.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton10.TabIndex = 11
Me.CypherxButton10.Text = "="
'
'CypherxButton9
'
Me.CypherxButton9.FadeInTime = 200
Me.CypherxButton9.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton9.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton9.Location = New System.Drawing.Point(128, 164)
Me.CypherxButton9.Name = "CypherxButton9"
Me.CypherxButton9.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton9.TabIndex = 9
Me.CypherxButton9.Text = "9"
'
'CypherxButton8
'
Me.CypherxButton8.FadeInTime = 200
Me.CypherxButton8.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton8.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton8.Location = New System.Drawing.Point(70, 164)
Me.CypherxButton8.Name = "CypherxButton8"
Me.CypherxButton8.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton8.TabIndex = 8
Me.CypherxButton8.Text = "8"
'
'CypherxButton7
'
Me.CypherxButton7.FadeInTime = 200
Me.CypherxButton7.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton7.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton7.Location = New System.Drawing.Point(12, 164)
Me.CypherxButton7.Name = "CypherxButton7"
Me.CypherxButton7.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton7.TabIndex = 7
Me.CypherxButton7.Text = "7"
'
'CypherxButton6
'
Me.CypherxButton6.FadeInTime = 200
Me.CypherxButton6.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton6.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton6.Location = New System.Drawing.Point(128, 135)
Me.CypherxButton6.Name = "CypherxButton6"
Me.CypherxButton6.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton6.TabIndex = 6
Me.CypherxButton6.Text = "6"
'
'CypherxButton5
'
Me.CypherxButton5.FadeInTime = 200
Me.CypherxButton5.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton5.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton5.Location = New System.Drawing.Point(70, 135)
Me.CypherxButton5.Name = "CypherxButton5"
Me.CypherxButton5.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton5.TabIndex = 5
Me.CypherxButton5.Text = "5"
'
'CypherxButton4
'
Me.CypherxButton4.FadeInTime = 200
Me.CypherxButton4.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton4.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton4.Location = New System.Drawing.Point(12, 135)
Me.CypherxButton4.Name = "CypherxButton4"
Me.CypherxButton4.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton4.TabIndex = 4
Me.CypherxButton4.Text = "4"
'
'CypherxButton3
'
Me.CypherxButton3.FadeInTime = 200
Me.CypherxButton3.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton3.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton3.Location = New System.Drawing.Point(128, 106)
Me.CypherxButton3.Name = "CypherxButton3"
Me.CypherxButton3.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton3.TabIndex = 3
Me.CypherxButton3.Text = "3"
'
'CypherxButton2
'
Me.CypherxButton2.FadeInTime = 200
Me.CypherxButton2.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton2.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton2.Location = New System.Drawing.Point(70, 106)
Me.CypherxButton2.Name = "CypherxButton2"
Me.CypherxButton2.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton2.TabIndex = 2
Me.CypherxButton2.Text = "2"
'
'CypherxButton1
'
Me.CypherxButton1.FadeInTime = 200
Me.CypherxButton1.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton1.Location = New System.Drawing.Point(12, 106)
Me.CypherxButton1.Name = "CypherxButton1"
Me.CypherxButton1.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton1.TabIndex = 1
Me.CypherxButton1.Text = "1"
'
'CypherxTheme1
'
Me.CypherxTheme1.Dock = System.Windows.Forms.DockStyle.Fill
Me.CypherxTheme1.Font = New System.Drawing.Font("Arial", 8.0!)
Me.CypherxTheme1.ForeColor = System.Drawing.Color.White
Me.CypherxTheme1.Icon = CType(resources.GetObject("CypherxTheme1.Icon"), System.Drawing.Icon)
Me.CypherxTheme1.Location = New System.Drawing.Point(0, 0)
Me.CypherxTheme1.MinimizeBox = True
Me.CypherxTheme1.Name = "CypherxTheme1"
Me.CypherxTheme1.Size = New System.Drawing.Size(365, 225)
Me.CypherxTheme1.TabIndex = 0
Me.CypherxTheme1.Text = "Calculatrice"
Me.CypherxTheme1.UseFadeOut = True
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 14.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(365, 225)
Me.Controls.Add(Me.CypherxButton14)
Me.Controls.Add(Me.CypherxButton13)
Me.Controls.Add(Me.CypherxButton12)
Me.Controls.Add(Me.CypherxButton11)
Me.Controls.Add(Me.TXT_EGALE)
Me.Controls.Add(Me.TXT_1)
Me.Controls.Add(Me.TXT_2)
Me.Controls.Add(Me.CypherxLabel1)
Me.Controls.Add(Me.CyperxSeperator2)
Me.Controls.Add(Me.CyperxSeperator1)
Me.Controls.Add(Me.moin)
Me.Controls.Add(Me.fois)
Me.Controls.Add(Me.diviser)
Me.Controls.Add(Me.plus)
Me.Controls.Add(Me.CypherxButton10)
Me.Controls.Add(Me.CypherxButton9)
Me.Controls.Add(Me.CypherxButton8)
Me.Controls.Add(Me.CypherxButton7)
Me.Controls.Add(Me.CypherxButton6)
Me.Controls.Add(Me.CypherxButton5)
Me.Controls.Add(Me.CypherxButton4)
Me.Controls.Add(Me.CypherxButton3)
Me.Controls.Add(Me.CypherxButton2)
Me.Controls.Add(Me.CypherxButton1)
Me.Controls.Add(Me.CypherxTheme1)
Me.Font = New System.Drawing.Font("Arial", 8.0!)
Me.ForeColor = System.Drawing.Color.White
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "Form1"
Me.Text = "Calculatrice"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents CypherxTheme1 As Calculatrice.CypherxTheme
Friend WithEvents CypherxButton1 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton2 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton3 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton4 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton5 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton6 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton7 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton8 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton9 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton10 As Calculatrice.CypherxButton
Friend WithEvents plus As Calculatrice.CypherxButton
Friend WithEvents diviser As Calculatrice.CypherxButton
Friend WithEvents fois As Calculatrice.CypherxButton
Friend WithEvents moin As Calculatrice.CypherxButton
Friend WithEvents CyperxSeperator1 As Calculatrice.CyperxSeperator
Friend WithEvents CyperxSeperator2 As Calculatrice.CyperxSeperator
Friend WithEvents CypherxLabel1 As Calculatrice.CypherxLabel
Friend WithEvents TXT_2 As System.Windows.Forms.TextBox
Friend WithEvents TXT_1 As System.Windows.Forms.TextBox
Friend WithEvents TXT_EGALE As System.Windows.Forms.TextBox
Friend WithEvents CypherxButton11 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton12 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton13 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton14 As Calculatrice.CypherxButton
End Class
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form remplace la méthode Dispose pour nettoyer la liste des composants.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Requise par le Concepteur Windows Form
Private components As System.ComponentModel.IContainer
'REMARQUE*: la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée à l'aide du Concepteur Windows Form.
'Ne la modifiez pas à l'aide de l'éditeur de code.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
Me.TXT_2 = New System.Windows.Forms.TextBox
Me.TXT_1 = New System.Windows.Forms.TextBox
Me.TXT_EGALE = New System.Windows.Forms.TextBox
Me.CypherxButton14 = New Calculatrice.CypherxButton
Me.CypherxButton13 = New Calculatrice.CypherxButton
Me.CypherxButton12 = New Calculatrice.CypherxButton
Me.CypherxButton11 = New Calculatrice.CypherxButton
Me.CypherxLabel1 = New Calculatrice.CypherxLabel
Me.CyperxSeperator2 = New Calculatrice.CyperxSeperator
Me.CyperxSeperator1 = New Calculatrice.CyperxSeperator
Me.moin = New Calculatrice.CypherxButton
Me.fois = New Calculatrice.CypherxButton
Me.diviser = New Calculatrice.CypherxButton
Me.plus = New Calculatrice.CypherxButton
Me.CypherxButton10 = New Calculatrice.CypherxButton
Me.CypherxButton9 = New Calculatrice.CypherxButton
Me.CypherxButton8 = New Calculatrice.CypherxButton
Me.CypherxButton7 = New Calculatrice.CypherxButton
Me.CypherxButton6 = New Calculatrice.CypherxButton
Me.CypherxButton5 = New Calculatrice.CypherxButton
Me.CypherxButton4 = New Calculatrice.CypherxButton
Me.CypherxButton3 = New Calculatrice.CypherxButton
Me.CypherxButton2 = New Calculatrice.CypherxButton
Me.CypherxButton1 = New Calculatrice.CypherxButton
Me.CypherxTheme1 = New Calculatrice.CypherxTheme
Me.SuspendLayout()
'
'TXT_2
'
Me.TXT_2.BackColor = System.Drawing.Color.White
Me.TXT_2.Location = New System.Drawing.Point(129, 65)
Me.TXT_2.Name = "TXT_2"
Me.TXT_2.ReadOnly = True
Me.TXT_2.Size = New System.Drawing.Size(109, 20)
Me.TXT_2.TabIndex = 28
'
'TXT_1
'
Me.TXT_1.BackColor = System.Drawing.Color.White
Me.TXT_1.Location = New System.Drawing.Point(13, 65)
Me.TXT_1.Name = "TXT_1"
Me.TXT_1.ReadOnly = True
Me.TXT_1.Size = New System.Drawing.Size(109, 20)
Me.TXT_1.TabIndex = 29
'
'TXT_EGALE
'
Me.TXT_EGALE.BackColor = System.Drawing.Color.White
Me.TXT_EGALE.Location = New System.Drawing.Point(243, 65)
Me.TXT_EGALE.Name = "TXT_EGALE"
Me.TXT_EGALE.ReadOnly = True
Me.TXT_EGALE.Size = New System.Drawing.Size(100, 20)
Me.TXT_EGALE.TabIndex = 30
'
'CypherxButton14
'
Me.CypherxButton14.FadeInTime = 200
Me.CypherxButton14.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton14.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton14.Location = New System.Drawing.Point(186, 193)
Me.CypherxButton14.Name = "CypherxButton14"
Me.CypherxButton14.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton14.TabIndex = 34
Me.CypherxButton14.Text = "x10"
'
'CypherxButton13
'
Me.CypherxButton13.FadeInTime = 200
Me.CypherxButton13.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton13.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton13.Location = New System.Drawing.Point(70, 193)
Me.CypherxButton13.Name = "CypherxButton13"
Me.CypherxButton13.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton13.TabIndex = 33
Me.CypherxButton13.Text = "0"
'
'CypherxButton12
'
Me.CypherxButton12.FadeInTime = 200
Me.CypherxButton12.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton12.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton12.Location = New System.Drawing.Point(243, 106)
Me.CypherxButton12.Name = "CypherxButton12"
Me.CypherxButton12.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton12.TabIndex = 32
Me.CypherxButton12.Text = "CE"
'
'CypherxButton11
'
Me.CypherxButton11.FadeInTime = 200
Me.CypherxButton11.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton11.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton11.Location = New System.Drawing.Point(301, 106)
Me.CypherxButton11.Name = "CypherxButton11"
Me.CypherxButton11.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton11.TabIndex = 31
Me.CypherxButton11.Text = "C"
'
'CypherxLabel1
'
Me.CypherxLabel1.AutoSize = True
Me.CypherxLabel1.BackColor = System.Drawing.Color.Transparent
Me.CypherxLabel1.Font = New System.Drawing.Font("Arial", 8.0!)
Me.CypherxLabel1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxLabel1.Location = New System.Drawing.Point(117, 31)
Me.CypherxLabel1.Name = "CypherxLabel1"
Me.CypherxLabel1.Size = New System.Drawing.Size(131, 14)
Me.CypherxLabel1.TabIndex = 24
Me.CypherxLabel1.Text = "Calculatrice By Bwisingw"
'
'CyperxSeperator2
'
Me.CyperxSeperator2.Location = New System.Drawing.Point(12, 93)
Me.CyperxSeperator2.Name = "CyperxSeperator2"
Me.CyperxSeperator2.Size = New System.Drawing.Size(341, 10)
Me.CyperxSeperator2.Style = Calculatrice.CyperxSeperator.Direction.Horizontal
Me.CyperxSeperator2.TabIndex = 23
Me.CyperxSeperator2.Text = "CyperxSeperator2"
Me.CyperxSeperator2.Thickness = 2
'
'CyperxSeperator1
'
Me.CyperxSeperator1.Location = New System.Drawing.Point(12, 48)
Me.CyperxSeperator1.Name = "CyperxSeperator1"
Me.CyperxSeperator1.Size = New System.Drawing.Size(341, 10)
Me.CyperxSeperator1.Style = Calculatrice.CyperxSeperator.Direction.Horizontal
Me.CyperxSeperator1.TabIndex = 22
Me.CyperxSeperator1.Text = "CyperxSeperator1"
Me.CyperxSeperator1.Thickness = 2
'
'moin
'
Me.moin.FadeInTime = 200
Me.moin.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.moin.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.moin.Location = New System.Drawing.Point(243, 164)
Me.moin.Name = "moin"
Me.moin.Size = New System.Drawing.Size(52, 23)
Me.moin.TabIndex = 15
Me.moin.Text = "-"
'
'fois
'
Me.fois.FadeInTime = 200
Me.fois.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.fois.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.fois.Location = New System.Drawing.Point(186, 135)
Me.fois.Name = "fois"
Me.fois.Size = New System.Drawing.Size(52, 23)
Me.fois.TabIndex = 14
Me.fois.Text = "x"
'
'diviser
'
Me.diviser.FadeInTime = 200
Me.diviser.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.diviser.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.diviser.Location = New System.Drawing.Point(243, 135)
Me.diviser.Name = "diviser"
Me.diviser.Size = New System.Drawing.Size(52, 23)
Me.diviser.TabIndex = 13
Me.diviser.Text = ":"
'
'plus
'
Me.plus.FadeInTime = 200
Me.plus.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.plus.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.plus.Location = New System.Drawing.Point(186, 164)
Me.plus.Name = "plus"
Me.plus.Size = New System.Drawing.Size(52, 23)
Me.plus.TabIndex = 12
Me.plus.Text = "+"
'
'CypherxButton10
'
Me.CypherxButton10.FadeInTime = 200
Me.CypherxButton10.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton10.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton10.Location = New System.Drawing.Point(301, 164)
Me.CypherxButton10.Name = "CypherxButton10"
Me.CypherxButton10.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton10.TabIndex = 11
Me.CypherxButton10.Text = "="
'
'CypherxButton9
'
Me.CypherxButton9.FadeInTime = 200
Me.CypherxButton9.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton9.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton9.Location = New System.Drawing.Point(128, 164)
Me.CypherxButton9.Name = "CypherxButton9"
Me.CypherxButton9.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton9.TabIndex = 9
Me.CypherxButton9.Text = "9"
'
'CypherxButton8
'
Me.CypherxButton8.FadeInTime = 200
Me.CypherxButton8.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton8.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton8.Location = New System.Drawing.Point(70, 164)
Me.CypherxButton8.Name = "CypherxButton8"
Me.CypherxButton8.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton8.TabIndex = 8
Me.CypherxButton8.Text = "8"
'
'CypherxButton7
'
Me.CypherxButton7.FadeInTime = 200
Me.CypherxButton7.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton7.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton7.Location = New System.Drawing.Point(12, 164)
Me.CypherxButton7.Name = "CypherxButton7"
Me.CypherxButton7.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton7.TabIndex = 7
Me.CypherxButton7.Text = "7"
'
'CypherxButton6
'
Me.CypherxButton6.FadeInTime = 200
Me.CypherxButton6.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton6.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton6.Location = New System.Drawing.Point(128, 135)
Me.CypherxButton6.Name = "CypherxButton6"
Me.CypherxButton6.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton6.TabIndex = 6
Me.CypherxButton6.Text = "6"
'
'CypherxButton5
'
Me.CypherxButton5.FadeInTime = 200
Me.CypherxButton5.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton5.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton5.Location = New System.Drawing.Point(70, 135)
Me.CypherxButton5.Name = "CypherxButton5"
Me.CypherxButton5.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton5.TabIndex = 5
Me.CypherxButton5.Text = "5"
'
'CypherxButton4
'
Me.CypherxButton4.FadeInTime = 200
Me.CypherxButton4.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton4.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton4.Location = New System.Drawing.Point(12, 135)
Me.CypherxButton4.Name = "CypherxButton4"
Me.CypherxButton4.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton4.TabIndex = 4
Me.CypherxButton4.Text = "4"
'
'CypherxButton3
'
Me.CypherxButton3.FadeInTime = 200
Me.CypherxButton3.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton3.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton3.Location = New System.Drawing.Point(128, 106)
Me.CypherxButton3.Name = "CypherxButton3"
Me.CypherxButton3.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton3.TabIndex = 3
Me.CypherxButton3.Text = "3"
'
'CypherxButton2
'
Me.CypherxButton2.FadeInTime = 200
Me.CypherxButton2.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton2.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton2.Location = New System.Drawing.Point(70, 106)
Me.CypherxButton2.Name = "CypherxButton2"
Me.CypherxButton2.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton2.TabIndex = 2
Me.CypherxButton2.Text = "2"
'
'CypherxButton1
'
Me.CypherxButton1.FadeInTime = 200
Me.CypherxButton1.Font = New System.Drawing.Font("Arial", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CypherxButton1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(124, Byte), Integer), CType(CType(195, Byte), Integer), CType(CType(255, Byte), Integer))
Me.CypherxButton1.Location = New System.Drawing.Point(12, 106)
Me.CypherxButton1.Name = "CypherxButton1"
Me.CypherxButton1.Size = New System.Drawing.Size(52, 23)
Me.CypherxButton1.TabIndex = 1
Me.CypherxButton1.Text = "1"
'
'CypherxTheme1
'
Me.CypherxTheme1.Dock = System.Windows.Forms.DockStyle.Fill
Me.CypherxTheme1.Font = New System.Drawing.Font("Arial", 8.0!)
Me.CypherxTheme1.ForeColor = System.Drawing.Color.White
Me.CypherxTheme1.Icon = CType(resources.GetObject("CypherxTheme1.Icon"), System.Drawing.Icon)
Me.CypherxTheme1.Location = New System.Drawing.Point(0, 0)
Me.CypherxTheme1.MinimizeBox = True
Me.CypherxTheme1.Name = "CypherxTheme1"
Me.CypherxTheme1.Size = New System.Drawing.Size(365, 225)
Me.CypherxTheme1.TabIndex = 0
Me.CypherxTheme1.Text = "Calculatrice"
Me.CypherxTheme1.UseFadeOut = True
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 14.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(365, 225)
Me.Controls.Add(Me.CypherxButton14)
Me.Controls.Add(Me.CypherxButton13)
Me.Controls.Add(Me.CypherxButton12)
Me.Controls.Add(Me.CypherxButton11)
Me.Controls.Add(Me.TXT_EGALE)
Me.Controls.Add(Me.TXT_1)
Me.Controls.Add(Me.TXT_2)
Me.Controls.Add(Me.CypherxLabel1)
Me.Controls.Add(Me.CyperxSeperator2)
Me.Controls.Add(Me.CyperxSeperator1)
Me.Controls.Add(Me.moin)
Me.Controls.Add(Me.fois)
Me.Controls.Add(Me.diviser)
Me.Controls.Add(Me.plus)
Me.Controls.Add(Me.CypherxButton10)
Me.Controls.Add(Me.CypherxButton9)
Me.Controls.Add(Me.CypherxButton8)
Me.Controls.Add(Me.CypherxButton7)
Me.Controls.Add(Me.CypherxButton6)
Me.Controls.Add(Me.CypherxButton5)
Me.Controls.Add(Me.CypherxButton4)
Me.Controls.Add(Me.CypherxButton3)
Me.Controls.Add(Me.CypherxButton2)
Me.Controls.Add(Me.CypherxButton1)
Me.Controls.Add(Me.CypherxTheme1)
Me.Font = New System.Drawing.Font("Arial", 8.0!)
Me.ForeColor = System.Drawing.Color.White
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "Form1"
Me.Text = "Calculatrice"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents CypherxTheme1 As Calculatrice.CypherxTheme
Friend WithEvents CypherxButton1 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton2 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton3 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton4 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton5 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton6 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton7 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton8 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton9 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton10 As Calculatrice.CypherxButton
Friend WithEvents plus As Calculatrice.CypherxButton
Friend WithEvents diviser As Calculatrice.CypherxButton
Friend WithEvents fois As Calculatrice.CypherxButton
Friend WithEvents moin As Calculatrice.CypherxButton
Friend WithEvents CyperxSeperator1 As Calculatrice.CyperxSeperator
Friend WithEvents CyperxSeperator2 As Calculatrice.CyperxSeperator
Friend WithEvents CypherxLabel1 As Calculatrice.CypherxLabel
Friend WithEvents TXT_2 As System.Windows.Forms.TextBox
Friend WithEvents TXT_1 As System.Windows.Forms.TextBox
Friend WithEvents TXT_EGALE As System.Windows.Forms.TextBox
Friend WithEvents CypherxButton11 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton12 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton13 As Calculatrice.CypherxButton
Friend WithEvents CypherxButton14 As Calculatrice.CypherxButton
End Class
ET CODAGE:
Public Class Form1
Private Sub CypherxButton13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles fois.Click
fois.Enabled = False
TXT_1.Enabled = False
End Sub
Private Sub CypherxButton14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles moin.Click
moin.Enabled = False
TXT_1.Enabled = False
End Sub
Private Sub CypherxButton11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles plus.Click
plus.Enabled = False
TXT_1.Enabled = False
End Sub
Private Sub CypherxButton12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles diviser.Click
diviser.Enabled = False
TXT_1.Enabled = False
End Sub
Private Sub CypherxButton11_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton11.Click
TXT_1.Clear()
TXT_2.Clear()
TXT_EGALE.Clear()
fois.Enabled = True
moin.Enabled = True
plus.Enabled = True
diviser.Enabled = True
TXT_1.Enabled = True
TXT_2.Enabled = True
End Sub
#Region "Calcule"
Private Sub CypherxButton10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton10.Click
If TXT_1.Text = "" Then
MsgBox("La 1er case est vide!")
ElseIf TXT_2.Text = "" Then
MsgBox("La 2eme case est vide!")
Else
If diviser.Enabled = False Then
Dim Somme As Integer = 0
Dim Somme1 As Integer = 0
Dim Somme2 As Integer = 0
Somme = Somme + TXT_1.Text
Somme1 = Somme1 + TXT_2.Text
Somme2 = Somme / Somme1
Me.TXT_EGALE.Text = Somme2
ElseIf fois.Enabled = False Then
Dim Somme As Integer = 0
Dim Somme1 As Integer = 0
Dim Somme2 As Integer = 0
Somme = Somme + TXT_1.Text
Somme1 = Somme1 + TXT_2.Text
Somme2 = Somme * Somme1
Me.TXT_EGALE.Text = Somme2
ElseIf moin.Enabled = False Then
Dim Somme As Integer = 0
Dim Somme1 As Integer = 0
Dim Somme2 As Integer = 0
Somme = Somme + TXT_1.Text
Somme1 = Somme1 + TXT_2.Text
Somme2 = Somme - Somme1
Me.TXT_EGALE.Text = Somme2
ElseIf plus.Enabled = False Then
Dim Somme As Integer = 0
Dim Somme1 As Integer = 0
Dim Somme2 As Integer = 0
Somme = Somme + TXT_1.Text
Somme1 = Somme1 + TXT_2.Text
Somme2 = Somme + Somme1
Me.TXT_EGALE.Text = Somme2
End If
TXT_2.Enabled = False
End If
End Sub
#End Region
#Region "Button Calcule"
Private Sub CypherxButton9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton9.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "9"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "9"
End If
End Sub
Private Sub CypherxButton8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton8.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "8"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "8"
End If
End Sub
Private Sub CypherxButton7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton7.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "7"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "7"
End If
End Sub
Private Sub CypherxButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton4.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "4"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "4"
End If
End Sub
Private Sub CypherxButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton1.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "1"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "1"
End If
End Sub
Private Sub CypherxButton6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton6.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "6"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "6"
End If
End Sub
Private Sub CypherxButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton3.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "3"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "3"
End If
End Sub
Private Sub CypherxButton13_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton13.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "0"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "0"
End If
End Sub
Private Sub CypherxButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton2.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "2"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "2"
End If
End Sub
Private Sub CypherxButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton5.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "5"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "5"
End If
End Sub
#End Region
Private Sub CypherxButton12_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton12.Click
If TXT_1.Enabled = False Then
TXT_2.Clear()
ElseIf TXT_1.Enabled = True Then
TXT_1.Clear()
End If
End Sub
Private Sub CypherxButton14_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton14.Click
Dim Somme As Integer = 0
Dim Somme1 As Integer = 0
Somme = TXT_1.Text
TXT_EGALE.Text = Somme * 10
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
CypherxTheme1.Text = "Calculatrice"
End Sub
End Class
Private Sub CypherxButton13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles fois.Click
fois.Enabled = False
TXT_1.Enabled = False
End Sub
Private Sub CypherxButton14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles moin.Click
moin.Enabled = False
TXT_1.Enabled = False
End Sub
Private Sub CypherxButton11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles plus.Click
plus.Enabled = False
TXT_1.Enabled = False
End Sub
Private Sub CypherxButton12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles diviser.Click
diviser.Enabled = False
TXT_1.Enabled = False
End Sub
Private Sub CypherxButton11_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton11.Click
TXT_1.Clear()
TXT_2.Clear()
TXT_EGALE.Clear()
fois.Enabled = True
moin.Enabled = True
plus.Enabled = True
diviser.Enabled = True
TXT_1.Enabled = True
TXT_2.Enabled = True
End Sub
#Region "Calcule"
Private Sub CypherxButton10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton10.Click
If TXT_1.Text = "" Then
MsgBox("La 1er case est vide!")
ElseIf TXT_2.Text = "" Then
MsgBox("La 2eme case est vide!")
Else
If diviser.Enabled = False Then
Dim Somme As Integer = 0
Dim Somme1 As Integer = 0
Dim Somme2 As Integer = 0
Somme = Somme + TXT_1.Text
Somme1 = Somme1 + TXT_2.Text
Somme2 = Somme / Somme1
Me.TXT_EGALE.Text = Somme2
ElseIf fois.Enabled = False Then
Dim Somme As Integer = 0
Dim Somme1 As Integer = 0
Dim Somme2 As Integer = 0
Somme = Somme + TXT_1.Text
Somme1 = Somme1 + TXT_2.Text
Somme2 = Somme * Somme1
Me.TXT_EGALE.Text = Somme2
ElseIf moin.Enabled = False Then
Dim Somme As Integer = 0
Dim Somme1 As Integer = 0
Dim Somme2 As Integer = 0
Somme = Somme + TXT_1.Text
Somme1 = Somme1 + TXT_2.Text
Somme2 = Somme - Somme1
Me.TXT_EGALE.Text = Somme2
ElseIf plus.Enabled = False Then
Dim Somme As Integer = 0
Dim Somme1 As Integer = 0
Dim Somme2 As Integer = 0
Somme = Somme + TXT_1.Text
Somme1 = Somme1 + TXT_2.Text
Somme2 = Somme + Somme1
Me.TXT_EGALE.Text = Somme2
End If
TXT_2.Enabled = False
End If
End Sub
#End Region
#Region "Button Calcule"
Private Sub CypherxButton9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton9.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "9"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "9"
End If
End Sub
Private Sub CypherxButton8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton8.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "8"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "8"
End If
End Sub
Private Sub CypherxButton7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton7.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "7"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "7"
End If
End Sub
Private Sub CypherxButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton4.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "4"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "4"
End If
End Sub
Private Sub CypherxButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton1.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "1"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "1"
End If
End Sub
Private Sub CypherxButton6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton6.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "6"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "6"
End If
End Sub
Private Sub CypherxButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton3.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "3"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "3"
End If
End Sub
Private Sub CypherxButton13_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton13.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "0"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "0"
End If
End Sub
Private Sub CypherxButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton2.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "2"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "2"
End If
End Sub
Private Sub CypherxButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton5.Click
If TXT_1.Enabled = True Then
TXT_1.Text = TXT_1.Text + "5"
ElseIf TXT_1.Enabled = False Then
TXT_2.Text = TXT_2.Text + "5"
End If
End Sub
#End Region
Private Sub CypherxButton12_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton12.Click
If TXT_1.Enabled = False Then
TXT_2.Clear()
ElseIf TXT_1.Enabled = True Then
TXT_1.Clear()
End If
End Sub
Private Sub CypherxButton14_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CypherxButton14.Click
Dim Somme As Integer = 0
Dim Somme1 As Integer = 0
Somme = TXT_1.Text
TXT_EGALE.Text = Somme * 10
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
CypherxTheme1.Text = "Calculatrice"
End Sub
End Class
La class:
Imports System.Drawing.Drawing2D
'
'
'Created By Marvinn (HF)
'Need Any help feel free to mail/pm me ([email protected])
'Please give propper credits!
'15/5/2011 16:30 (Dutch/Netherlands)
'Updated Seperator, Property's: Thickness, Style(Vertical, Horizontal)
'
'
Public Class CypherxButton
Inherits Control
Dim T As Timer
Sub New()
Font = New Font("Arial", 8)
ForeColor = FC
T = New Timer
T.Interval = _time / 10
AddHandler T.Tick, AddressOf FadeIn
End Sub
Dim _time As Integer = 200
Public Property FadeInTime() As Integer
Get
Return _time
End Get
Set(ByVal value As Integer)
_time = value
T.Interval = value / 10
End Set
End Property
Dim last As Integer = 0
Dim alpha As Integer = 0
Sub FadeIn()
If alpha = 255 Then
T.Stop()
Exit Sub
End If
alpha = CalculateAlpha(last)
Invalidate()
last += 10
End Sub
Function CalculateAlpha(ByVal Opacity As Integer) As Integer
Return (255 / 100) * Opacity
End Function
Private Enum State
MouseDown
MouseEnter
MouseLeft
End Enum
Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
MouseState = State.MouseLeft
Invalidate()
End Sub
Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
MouseState = State.MouseEnter
alpha = 0
last = 0
T.Start()
End Sub
Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
MouseState = State.MouseEnter
alpha = 255
Invalidate()
MyBase.OnMouseDown(e)
End Sub
Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
alpha = 255
Invalidate()
End Sub
Dim GC1 As Color = Color.FromArgb(75, 75, 75)
Dim GC2 As Color = Color.FromArgb(65, 65, 65)
Dim GC3 As Color = Color.FromArgb(63, 63, 63)
Dim GC4 As Color = Color.FromArgb(100, 100, 100)
Dim GC5 As Color = Color.FromArgb(130, 130, 130)
Dim GC6 As Color = Color.FromArgb(120, 120, 120)
Dim PC1 As Color = Color.FromArgb(50, 50, 50)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Dim P As Pen
Dim MouseState As State = State.MouseLeft
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
Dim OuterR As New Rectangle(0, 0, Width - 1, Height - 1)
Dim InnerR As New Rectangle(1, 1, Width - 3, Height - 3)
Dim UpHalf As New Rectangle(0, 0, Width, (Height - 1) / 2)
Dim DownHalf As New Rectangle(0, (Height - 2) / 2, Width, (Height - 1) / 2)
Select Case MouseState
Case State.MouseLeft
Draw.Gradient(g, GC1, GC2, UpHalf)
Draw.Gradient(g, GC3, GC2, DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
ForeColor = FC
Case State.MouseEnter
If alpha < 255 Then
Draw.Gradient(g, GC1, GC2, UpHalf)
Draw.Gradient(g, GC3, GC2, DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
End If
Draw.Gradient(g, Color.FromArgb(alpha, GC5), Color.FromArgb(alpha, GC6), UpHalf)
Draw.Gradient(g, Color.FromArgb(alpha, GC4), Color.FromArgb(alpha, GC6), DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
ForeColor = Color.FromArgb(23, 32, 37)
End Select
Dim S As SizeF = g.MeasureString(Text, Font)
g.DrawString(Text, Font, New SolidBrush(ForeColor), CInt(Width \ 2 - S.Width \ 2), CInt(Height \ 2 - S.Height \ 2))
e.Graphics.DrawImage(b.Clone, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
End Sub
End Class
Public Class CypherxTheme
Inherits Control
Dim needtopaintbg As Boolean = True
Protected Overrides Sub OnHandleCreated(ByVal e As System.EventArgs)
'Dock = DockStyle.Fill
'DoubleBuffered = True
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
.FormBorderStyle = 0
.BackColor = BgC
.ForeColor = Color.White
.Font = New Font("Arial", 8)
Font = .Font
ForeColor = .ForeColor
Text = .Text
_Icon = .Icon
End With
End If
End Sub
Sub New()
Dock = DockStyle.Fill
DoubleBuffered = True
End Sub
Protected Overrides Sub OnSizeChanged(ByVal e As System.EventArgs)
Invalidate()
MyBase.OnSizeChanged(e)
End Sub
Dim Balk As New Rectangle(4, 4, Width - 8, 27)
Dim BgC As Color = Color.FromArgb(28, 28, 28)
Dim Br As SolidBrush
Dim PC1 As Color = Color.FromArgb(50, 50, 50)
Dim PC2 As Color = Color.FromArgb(66, 66, 66)
Dim PC3 As Color = Color.FromArgb(79, 79, 79)
Dim BC1 As Color = Color.FromArgb(86, 86, 86)
Dim BC2 As Color = Color.FromArgb(71, 71, 71)
Dim P As Pen
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
Br = New SolidBrush(BgC)
g.FillRectangle(Br, New Rectangle(0, 0, Width, Height))
P = New Pen(PC1)
g.DrawRectangle(P, New Rectangle(0, 0, Width - 2, Height - 1))
P = New Pen(PC2)
g.DrawRectangle(P, New Rectangle(1, 1, Width - 3, Height - 3))
P = New Pen(PC3, 2)
g.DrawRectangle(P, New Rectangle(3, 3, Width - 6, Height - 6))
Dim BovenHelftBalk As New Rectangle(4, 4, Width - 8, CInt(27 / 2))
Dim OnderHelftBalk As New Rectangle(4, CInt(27 / 2) + 2, Width - 8, CInt(27 / 2))
g.FillRectangle(New SolidBrush(Color.FromArgb(200, BC1)), BovenHelftBalk)
g.FillRectangle(New SolidBrush(Color.FromArgb(150, BC2)), OnderHelftBalk)
g.DrawImage(ResizeIcon, New Rectangle(10, 10, 16, 16))
Dim S = g.MeasureString(Text, Font)
g.DrawString(Text, New Font("Arial", 8, FontStyle.Bold), New SolidBrush(ForeColor), 36, 10)
Dim MinimizeRec As New Rectangle(Width - 32, 16, 9, 5)
If Minibox Then
Select Case EnteredMinimize
Case True
g.FillRectangle(Brushes.White, MinimizeRec)
g.DrawRectangle(New Pen(Color.FromArgb(255, Color.Black), 1), MinimizeRec)
Case False
g.FillRectangle(New SolidBrush(Color.FromArgb(100, Color.White)), MinimizeRec)
g.DrawRectangle(New Pen(Color.FromArgb(150, Color.Black), 1), MinimizeRec)
End Select
End If
Select Case EntredClose
Case True
g.DrawString("x", New Font("Arial", 13, FontStyle.Bold), Brushes.White, Width - 20, 5)
Case False
Br = New SolidBrush(Color.FromArgb(100, Color.White))
g.DrawString("x", New Font("Arial", 13, FontStyle.Bold), Br, Width - 20, 5)
End Select
e.Graphics.DrawImage(b, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
Dim EnteredMinimize As Boolean = False
Dim EntredClose As Boolean = False
Function IconCheck() As Boolean
Try
If Icon.Width > 0 Then
Return True
Else
Return False
End If
Catch ex As Exception
Return False
End Try
End Function
Function ResizeIcon() As Bitmap
If Not IconCheck() Then
Try
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
_Icon = .Icon
End With
End If
Catch ex As Exception
End Try
End If
Try
Dim TempIcon As Icon = _Icon
Dim TempBitmap As Bitmap = New Bitmap(32, 32)
Dim BitmapGraphic As Graphics = Graphics.FromImage(TempBitmap)
Dim XPos, YPos As Integer
XPos = (TempBitmap.Width - TempIcon.Width) \ 2
YPos = (TempBitmap.Height - TempIcon.Height) \ 2
BitmapGraphic.DrawIcon(TempIcon, New Rectangle(XPos, YPos, TempIcon.Width, TempIcon.Height))
Return TempBitmap
Catch ex As Exception
Return _Icon.ToBitmap
End Try
End Function
Dim _Icon As Icon
Public Property Icon() As Icon
Get
Return _Icon
End Get
Set(ByVal value As Icon)
_Icon = value
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
.Icon = value
_Icon = value
Invalidate()
End With
End If
End Set
End Property
Dim FadingOut As Boolean = True
Public Property UseFadeOut() As Boolean
Get
Return FadingOut
End Get
Set(ByVal value As Boolean)
FadingOut = value
End Set
End Property
Dim Minibox As Boolean = True
Public Property MinimizeBox() As Boolean
Get
Return Minibox
End Get
Set(ByVal value As Boolean)
Minibox = value
Invalidate()
End Set
End Property
#Region " Global Variables "
Dim Point As New Point()
Dim X, Y As Integer
#End Region
#Region " GUI "
Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)
Dim Last As Boolean = EnteredMinimize
Dim MinimizeRec As New Rectangle(Width - 32, 16, 9, 5)
If MinimizeRec.Contains(e.Location) Then
EnteredMinimize = True
Else
EnteredMinimize = False
End If
If Not Last = EnteredMinimize Then
Invalidate()
End If
Last = EntredClose
Dim CloseRec As New Rectangle(Width - 20, 5, 16, 16)
If CloseRec.Contains(e.Location) Then
EntredClose = True
Else
EntredClose = False
End If
If Not Last = EntredClose Then
Invalidate()
End If
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
If e.Button = MouseButtons.Left And e.Location.X < Width And e.Location.Y < Balk.Height Then
Point = Control.MousePosition
Point.X = Point.X - (X)
Point.Y = Point.Y - (Y)
.Location = Point
End If
End With
End If
MyBase.OnMouseMove(e)
End Sub
Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
X = Control.MousePosition.X - .Location.X
Y = Control.MousePosition.Y - .Location.Y
End With
End If
Dim MinimizeRec As New Rectangle(Width - 32, 16, 9, 5)
If MinimizeRec.Contains(e.Location) Then
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
.WindowState = FormWindowState.Minimized
End With
End If
End If
Dim CloseRec As New Rectangle(Width - 20, 5, 16, 16)
If CloseRec.Contains(e.Location) Then
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
If FadingOut Then FadeOut()
.Close()
End With
End If
End If
MyBase.OnMouseDown(e)
End Sub
#End Region
Function FadeOut()
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
For i As Double = 1 To 0.0 Step -0.1
.Opacity = i
Threading.Thread.Sleep(50)
Next
End With
End If
Return True
End Function
End Class
Public Class CypherxLabel
Inherits Label
Dim FC As Color = Color.FromArgb(124, 195, 255)
Sub New()
Font = New Font("Arial", 8)
ForeColor = FC
BackColor = Color.Transparent
End Sub
End Class
Public Class CyperxProgressbar
Inherits Control
Sub New()
Font = New Font("Arial", 8)
ForeColor = Color.White
End Sub
Dim _UseColor As Boolean = False
Public Property Colorize() As Boolean
Get
Return _UseColor
End Get
Set(ByVal value As Boolean)
_UseColor = value
Invalidate()
End Set
End Property
Dim Perc As Double = 0
Public ReadOnly Property Percentage() As Double
Get
Return Perc
End Get
End Property
Dim BC1 As Color = Color.FromArgb(90, 90, 90)
Dim BC2 As Color = Color.FromArgb(71, 71, 71)
Dim PC1 As Color = Color.FromArgb(50, 50, 50)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
Dim WholeR As New Rectangle(0, 0, Width - 1, Height - 1)
Draw.Gradient(g, _Lightcolor, _DarkColor, WholeR)
g.DrawRectangle(Pens.Black, WholeR)
Dim OneProcent As Double = Maximum / 100
Dim ProgressProcent As Integer = _Progress / OneProcent
Console.WriteLine(ProgressProcent)
Dim ProgressRec As New Rectangle(2, 2, CInt((Width - 4) * (ProgressProcent * 0.01)), Height - 4)
Perc = _Progress / (Maximum / 100)
Select Case _UseColor
Case False
g.FillRectangle(New SolidBrush(Color.FromArgb(100, Color.Black)), ProgressRec)
Case True
Dim Drawcolor As Color = Color.FromArgb(150, 255 - 2 * ProgressProcent, (1.7 * ProgressProcent), 0)
g.FillRectangle(New SolidBrush(Color.FromArgb(50, Drawcolor)), ProgressRec)
End Select
If Showt Then g.DrawString(Text, Font, New SolidBrush(ForeColor), New Point(3, 4))
e.Graphics.DrawImage(b, 0, 0)
End Using
End Using
End Sub
Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
End Sub
#Region " Properties "
Dim Showt As Boolean = True
Public Property ShowText() As Boolean
Get
Return Showt
End Get
Set(ByVal value As Boolean)
Showt = value
Invalidate()
End Set
End Property
Private _Maximum As Double = 100
Public Property Maximum() As Double
Get
Return _Maximum
End Get
Set(ByVal value As Double)
_Maximum = value
value = _Current / value * 100
Invalidate()
End Set
End Property
Private _Current As Double
Public Property Current() As Double
Get
Return _Current
End Get
Set(ByVal value As Double)
_Current = value
value = value / _Maximum * 100
Invalidate()
End Set
End Property
Private _Progress As Integer
Public Property Value() As Double
Get
Return _Progress
End Get
Set(ByVal value As Double)
If value < 0 Then value = 0 Else If value > Maximum Then value = Maximum
_Progress = CInt(value)
_Current = value * 0.01 * _Maximum
Invalidate()
End Set
End Property
Public Property DarkColor() As Color
Get
Return _DarkColor
End Get
Set(ByVal value As Color)
_DarkColor = value
Invalidate()
End Set
End Property
Public Property Lightcolor() As Color
Get
Return _Lightcolor
End Get
Set(ByVal value As Color)
_Lightcolor = value
Invalidate()
End Set
End Property
#End Region
#Region " Colors "
Dim _Lightcolor As Color = BC2
Dim _DarkColor = BC1
#End Region
End Class
Public Class CyperxTextbox
Inherits Control
Dim Bg As Color = Color.FromArgb(28, 28, 28)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Dim tbox As TextBox
Sub New()
Me.Text = ""
tbox = Nothing
tbox = New TextBox
tbox.Text = Text
tbox.BorderStyle = BorderStyle.None
tbox.BackColor = Bg
tbox.Location = New Point(3, 4)
tbox.Width = Width - 7
tbox.Font = Font
tbox.UseSystemPasswordChar = Pwbox
tbox.ForeColor = FC
Me.Controls.Add(tbox)
AddHandler tbox.TextChanged, AddressOf TextChange
End Sub
Dim Pwbox As Boolean = False
Dim DrawRounded As Boolean = True
Public Property Rounded() As Boolean
Get
Return DrawRounded
End Get
Set(ByVal value As Boolean)
DrawRounded = value
End Set
End Property
Public Property UseSystemPasswordChar() As Boolean
Get
Return Pwbox
End Get
Set(ByVal value As Boolean)
Pwbox = value
tbox = Nothing
tbox = New TextBox
tbox.Text = Text
tbox.BorderStyle = BorderStyle.None
tbox.BackColor = Bg
tbox.Location = New Point(3, 4)
tbox.Width = Width - 7
tbox.Font = Font
tbox.UseSystemPasswordChar = Pwbox
tbox.ForeColor = FC
Me.Controls.Add(tbox)
AddHandler tbox.TextChanged, AddressOf TextChange
End Set
End Property
Private Sub TextChange()
Me.Text = tbox.Text
End Sub
Dim p As Pen
Dim sb As SolidBrush
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
sb = New SolidBrush(Bg)
g.FillRectangle(sb, New Rectangle(0, 0, Width, Height))
p = New Pen(PC2)
If DrawRounded Then
Dim Outline As GraphicsPath = Draw.RoundedRectangle(0, 0, Width - 1, Height - 1, 10, 1)
g.DrawPath(p, Outline)
Else
Dim rec As New Rectangle(0, 0, Width - 1, Height - 1)
g.DrawRectangle(p, rec)
End If
e.Graphics.DrawImage(b, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
End Class
Public Class CypherxGroupBox
Inherits Panel
Dim Bg As Color = Color.FromArgb(28, 28, 28)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Dim p As Pen
Dim sb As SolidBrush
Sub New()
BackColor = Bg
End Sub
Dim _t As String = ""
Public Property Header() As String
Get
Return _t
End Get
Set(ByVal value As String)
_t = value
Invalidate()
End Set
End Property
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
p = New Pen(PC2)
sb = New SolidBrush(Bg)
Dim M As SizeF = g.MeasureString(_t, Font)
Dim Outline As GraphicsPath = Draw.RoundedRectangle(0, M.Height / 2, Width - 1, Height - 1, 10, 1)
g.Clear(BackColor)
g.FillRectangle(sb, New Rectangle(0, M.Height / 2, Width - 1, Height - 1))
g.DrawPath(p, Outline)
g.FillRectangle(sb, New Rectangle(10, (M.Height / 2) - 2, M.Width + 10, M.Height))
sb = New SolidBrush(FC)
g.DrawString(_t, Font, sb, 12, 2)
e.Graphics.DrawImage(b, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
End Class
Public Class CyperxSeperator
Inherits Control
Dim Bg As Color = Color.FromArgb(28, 28, 28)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Dim p As Pen
Dim sb As SolidBrush
Public Enum Direction
Horizontal
Vertical
End Enum
Dim Dir As Direction = Direction.Horizontal
Public Property Style() As DIRECTION
Get
Return Dir
End Get
Set(ByVal value As DIRECTION)
Dir = value
Invalidate()
End Set
End Property
Dim H As Integer = 2
Public Property Thickness() As Integer
Get
Return H
End Get
Set(ByVal value As Integer)
H = value
Invalidate()
End Set
End Property
Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
End Sub
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
g.Clear(BackColor)
sb = New SolidBrush(Bg)
g.FillRectangle(sb, New Rectangle(0, 0, Width, Height))
Select Case Dir
Case Direction.Horizontal
Dim GRec As New Rectangle(0, Height / 2, Width / 5, H)
Using GBrush As LinearGradientBrush = New LinearGradientBrush(GRec, Color.Transparent, FC, LinearGradientMode.Horizontal)
g.FillRectangle(GBrush, GRec)
End Using
p = New Pen(FC, H)
Dim x As Integer = Math.Floor(H / 2)
g.DrawLine(p, New Point(GRec.Width, GRec.Y + x), New Point(Width - GRec.Width + 1, GRec.Y + x))
GRec = New Rectangle(Width - (Width / 5), Height / 2, Width / 5, H)
Using GBrush As LinearGradientBrush = New LinearGradientBrush(GRec, FC, Color.Transparent, LinearGradientMode.Horizontal)
g.FillRectangle(GBrush, GRec)
End Using
Case Direction.Vertical
Dim GRec As New Rectangle(Width / 2, 0, H, Height / 5)
Using GBrush As LinearGradientBrush = New LinearGradientBrush(GRec, Color.Transparent, FC, LinearGradientMode.Vertical)
g.FillRectangle(GBrush, GRec)
End Using
p = New Pen(FC, H)
Dim x As Integer = Math.Floor(H / 2)
g.DrawLine(p, New Point(GRec.X + x, Height / 5), New Point(GRec.X + x, Height - (Height / 5)))
GRec = New Rectangle(GRec.X, Height - (Height / 5) - 1, H, Height / 5)
Using GBrush As LinearGradientBrush = New LinearGradientBrush(GRec, FC, Color.Transparent, LinearGradientMode.Vertical)
g.FillRectangle(GBrush, GRec)
End Using
End Select
e.Graphics.DrawImage(b, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
End Class
Public Class CyperxComboBox
Inherits Control
Dim t As Timer
Sub New()
Font = New Font("Arial", 8)
ForeColor = Color.White
MinimumSize = New Size(130, 23)
t = New Timer
t.Interval = _time / 10
AddHandler t.Tick, AddressOf FadeIn
End Sub
Dim _time As Integer = 200
Public Property FadeInTime() As Integer
Get
Return _time
End Get
Set(ByVal value As Integer)
_time = value
t.Interval = value / 10
End Set
End Property
Dim last As Integer = 0
Dim alpha As Integer = 0
Sub FadeIn()
If alpha = 255 Then
T.Stop()
Exit Sub
End If
alpha = CalculateAlpha(last)
Invalidate()
last += 10
End Sub
Function CalculateAlpha(ByVal Opacity As Integer) As Integer
Return (255 / 100) * Opacity
End Function
Dim LastItems() As String
Protected Overrides Sub OnHandleCreated(ByVal e As System.EventArgs)
Try
If _Items.Length = 0 Then _Items = New String() {Text}
Catch ex As Exception
_Items = New String() {Text}
End Try
LastItems = _Items
pop = New Popup(_Items)
pop.Location = New Point(Location.X, Location.Y + Height + 2)
pop.Visible = False
Invoke(New AddX(AddressOf AddControl), pop)
MyBase.OnHandleCreated(e)
End Sub
Private Enum State
MouseDown = 0
MouseEnter = 1
MouseLeft = 2
Wait = 3
End Enum
Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
If Not MouseState = State.Wait Then
MouseState = State.MouseLeft
alpha = 0
last = 0
Invalidate()
End If
End Sub
Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
If Not MouseState = State.Wait Then
MouseState = State.MouseEnter
t.Start()
End If
End Sub
Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
If Not MouseState = State.Wait Then
MouseState = State.MouseEnter
Invalidate()
End If
End Sub
Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
MouseState = State.Wait
t.Stop()
alpha = 255
Dim ShowPopup As New Threading.Thread(AddressOf ShowAndWait)
ShowPopup.Start()
Invalidate()
MyBase.OnMouseDown(e)
End Sub
Dim pop As Popup
Delegate Sub ShowPopD(ByVal shown As Boolean)
Sub ShowPop(ByVal show As Boolean)
pop.Visible = show
End Sub
Sub ShowAndWait()
If pop.Showing Then Exit Sub
pop = Nothing
pop = New Popup(_Items)
pop.Location = New Point(Location.X, Location.Y + Height + 2)
Invoke(New AddX(AddressOf AddControl), pop)
pop.WaitForInput()
alpha = 0
last = 0
MouseState = State.MouseLeft
If Not pop.SelectedItem = "" Then
Invoke(New UpdateTextD(AddressOf UpdateText), pop.SelectedItem)
Else
Invoke(New UpdateTextD(AddressOf UpdateText), Text)
End If
End Sub
Delegate Sub UpdateTextD(ByVal text As String)
Sub UpdateText(ByVal text As String)
Me.Text = text
Invalidate()
End Sub
Delegate Sub AddX(ByVal control As Control)
Sub AddControl(ByVal control As Control)
Parent.Controls.Add(control)
End Sub
Dim _Items() As String
Public Property Items() As String()
Get
Return _Items
End Get
Set(ByVal value As String())
_Items = value
Invalidate()
End Set
End Property
Dim MouseState As State = State.MouseLeft
Dim GC1 As Color = Color.FromArgb(75, 75, 75)
Dim GC2 As Color = Color.FromArgb(65, 65, 65)
Dim GC3 As Color = Color.FromArgb(63, 63, 63)
Dim GC4 As Color = Color.FromArgb(100, 100, 100)
Dim GC5 As Color = Color.FromArgb(130, 130, 130)
Dim GC6 As Color = Color.FromArgb(120, 120, 120)
Dim PC1 As Color = Color.FromArgb(50, 50, 50)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Dim P As Pen
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
Dim OuterR As New Rectangle(0, 0, Width - 1, Height - 1)
Dim InnerR As New Rectangle(1, 1, Width - 3, Height - 3)
Dim UpHalf As New Rectangle(2, 2, Width - 3, (Height - 1) / 2)
Dim DownHalf As New Rectangle(2, (Height - 1) / 2, Width - 3, (Height - 1) / 2)
Select Case MouseState
Case State.MouseLeft
Draw.Gradient(g, GC1, GC2, UpHalf)
Draw.Gradient(g, GC3, GC2, DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
ForeColor = FC
Case State.MouseEnter
If alpha < 255 Then
Draw.Gradient(g, GC1, GC2, UpHalf)
Draw.Gradient(g, GC3, GC2, DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
End If
Draw.Gradient(g, Color.FromArgb(alpha, GC5), Color.FromArgb(alpha, GC6), UpHalf)
Draw.Gradient(g, Color.FromArgb(alpha, GC4), Color.FromArgb(alpha, GC6), DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
ForeColor = Color.FromArgb(23, 32, 37)
Case State.Wait
Draw.Gradient(g, Color.FromArgb(alpha, GC5), Color.FromArgb(alpha, GC6), UpHalf)
Draw.Gradient(g, Color.FromArgb(alpha, GC4), Color.FromArgb(alpha, GC6), DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
ForeColor = Color.FromArgb(23, 32, 37)
End Select
If ShowS Then
Dim UpRec As New Rectangle(Width - 18, 2, 1, 5)
Draw.Gradient(g, Color.Transparent, PC2, UpRec)
P = New Pen(PC2)
g.DrawLine(P, New Point(Width - 18, 7), New Point(Width - 18, Height - 7))
Draw.Gradient(g, PC2, Color.Transparent, New Rectangle(Width - 18, Height - 7, 1, 5))
End If
P = New Pen(Brushes.White, 2)
g.DrawLine(P, New Point(Width - 15, 9), New Point(Width - 10, 14))
g.DrawLine(P, New Point(Width - 5, 9), New Point(Width - 10, 14))
Dim S As SizeF = g.MeasureString(Text, Font)
g.DrawString(Text, Font, New SolidBrush(ForeColor), 5, CInt(Height / 2 - S.Height / 2))
e.Graphics.DrawImage(b.Clone, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
Dim ShowS As Boolean = True
Public Property ShowSeperator() As Boolean
Get
Return ShowS
End Get
Set(ByVal value As Boolean)
ShowS = value
Invalidate()
End Set
End Property
Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
End Sub
End Class
Public Class Popup
Inherits Control
Dim _items() As String
Dim ListOfRec As New List(Of Rectangle)
Sub New()
Throw New Exception("You can't add this direct to the Designer!")
End Sub
Sub New(ByVal items As String())
DoubleBuffered = True
_items = items
FixWidth()
FixList()
End Sub
Protected Overrides Sub OnHandleCreated(ByVal e As System.EventArgs)
Console.WriteLine(TopLevelControl.TopLevelControl)
BringToFront()
Shown = True
MyBase.OnHandleCreated(e)
End Sub
Dim MyMousedown As Boolean = False
Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
MyMousedown = True
Invalidate()
_item = Temp_item
Console.WriteLine("Item: " & SelectedItem)
Input = True
Shown = False
Visible = False
MyBase.OnMouseDown(e)
End Sub
Sub FixWidth()
Dim G As Graphics = Graphics.FromImage(New Bitmap(1, 1))
Dim LongestWidth As Integer = 0
For Each Str As String In _items
If G.MeasureString(Str, Font).Width > LongestWidth Then
LongestWidth = G.MeasureString(Str, Font).Width
End If
Next
If LongestWidth < 85 Then
Width = 95
Else
Me.Width = LongestWidth + 9
End If
End Sub
Dim Shown As Boolean = False
Public ReadOnly Property Showing() As Boolean
Get
Return Shown
End Get
End Property
Sub FixList()
Dim MyHeight = 23 * _items.Length - 1
Dim AantalRecs As Integer = MyHeight / 23
ListOfRec.Add(New Rectangle(2, 3, Width - 5, 23))
For i As Integer = 1 To AantalRecs
Dim rec As New Rectangle(2, 23 * i, Width - 5, 23)
ListOfRec.Add(rec)
Next
Me.Height = MyHeight + 5
Invalidate()
End Sub
Dim SelectedReg As New Rectangle(0, 0, 0, 0)
Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)
Dim Oldrec As Rectangle = SelectedReg
For Each rec As Rectangle In ListOfRec
If rec.Contains(e.Location) Then
SelectedReg = rec
End If
Next
If Not Oldrec = SelectedReg Then
Invalidate()
End If
MyBase.OnMouseMove(e)
End Sub
Dim Input As Boolean = False
Public Sub WaitForInput()
Do While Input = False
Threading.Thread.Sleep(1)
Loop
End Sub
Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
SelectedReg = New Rectangle(0, 0, 0, 0)
Me.Visible = False
Input = True
Shown = False
MyBase.OnMouseLeave(e)
End Sub
Dim _item As String = ""
Public Property SelectedItem() As String
Get
Return _item
End Get
Set(ByVal value As String)
_item = value
End Set
End Property
Dim BC1 As Color = Color.FromArgb(90, 90, 90)
Dim BC2 As Color = Color.FromArgb(71, 71, 71)
Dim PC1 As Color = Color.FromArgb(50, 50, 50)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Dim SB As SolidBrush
Dim p As Pen
Dim Temp_item As String = ""
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
Dim Fullrec As New Rectangle(0, 0, Width - 1, Height - 1)
SB = New SolidBrush(BC2)
p = New Pen(PC2)
g.FillRectangle(SB, Fullrec)
g.DrawRectangle(p, Fullrec)
SB = New SolidBrush(BC1)
g.FillRectangle(SB, SelectedReg)
p = New Pen(FC)
g.DrawRectangle(p, SelectedReg)
If SelectedReg.Contains(New Point(5, 5)) Then
SB = New SolidBrush(FC)
g.DrawString(_items(0), Font, SB, 5, 7)
Console.WriteLine("Selected item " & _items(0))
Temp_item = _items(0)
Else
g.DrawString(_items(0), Font, Brushes.White, 5, 7)
End If
For I As Integer = 1 To _items.Length - 1
If SelectedReg.Contains(New Point(5, I * 23 + 5)) Then
SB = New SolidBrush(FC)
g.DrawString(_items(I), Font, SB, 5, I * 23 + 5)
Console.WriteLine("Selected item: " & _items(I))
Temp_item = _items(I)
Else
g.DrawString(_items(I), Font, Brushes.White, 5, I * 23 + 5)
End If
Next
e.Graphics.DrawImage(b, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
End Class
'
'
'Created By Aeonhack
'
'
Public Class Draw
Shared Sub Gradient(ByVal g As Graphics, ByVal c1 As Color, ByVal c2 As Color, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer)
Dim R As New Rectangle(x, y, width, height)
Using T As New LinearGradientBrush(R, c1, c2, LinearGradientMode.Vertical)
g.FillRectangle(T, R)
End Using
End Sub
Shared Sub Gradient(ByVal g As Graphics, ByVal c1 As Color, ByVal c2 As Color, ByVal r As Rectangle)
Using T As New LinearGradientBrush(R, c1, c2, LinearGradientMode.Vertical)
g.FillRectangle(T, R)
End Using
End Sub
Shared Sub Blend(ByVal g As Graphics, ByVal c1 As Color, ByVal c2 As Color, ByVal c3 As Color, ByVal c As Single, ByVal d As Integer, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer)
Dim v As New ColorBlend(3)
V.Colors = New Color() {c1, c2, c3}
V.Positions = New Single() {0, c, 1}
Dim R As New Rectangle(x, y, width, height)
Using T As New LinearGradientBrush(R, c1, c1, CType(d, LinearGradientMode))
T.InterpolationColors = v : g.FillRectangle(T, R)
End Using
End Sub
Shared Function RoundedRectangle(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal cornerwidth As Integer, ByVal PenWidth As Integer) As GraphicsPath
Dim p As New GraphicsPath
p.StartFigure()
p.AddArc(New Rectangle(x, y, cornerwidth, cornerwidth), 180, 90)
p.AddLine(cornerwidth, y, width - cornerwidth - PenWidth, y)
p.AddArc(New Rectangle(width - cornerwidth - PenWidth, y, cornerwidth, cornerwidth), -90, 90)
p.AddLine(width - PenWidth, cornerwidth, width - PenWidth, height - cornerwidth - PenWidth)
p.AddArc(New Rectangle(width - cornerwidth - PenWidth, height - cornerwidth - PenWidth, cornerwidth, cornerwidth), 0, 90)
p.AddLine(width - cornerwidth - PenWidth, height - PenWidth, cornerwidth, height - PenWidth)
p.AddArc(New Rectangle(x, height - cornerwidth - PenWidth, cornerwidth, cornerwidth), 90, 90)
p.CloseFigure()
Return p
End Function
Shared Sub BackGround(ByVal width As Integer, ByVal height As Integer, ByVal G As Graphics)
Dim P1 As Color = Color.FromArgb(29, 25, 22)
Dim P2 As Color = Color.FromArgb(35, 31, 28)
For y As Integer = 0 To height Step 4
For x As Integer = 0 To width Step 4
G.FillRectangle(New SolidBrush(P1), New Rectangle(x, y, 1, 1))
G.FillRectangle(New SolidBrush(P2), New Rectangle(x, y + 1, 1, 1))
Try
G.FillRectangle(New SolidBrush(P1), New Rectangle(x + 2, y + 2, 1, 1))
G.FillRectangle(New SolidBrush(P2), New Rectangle(x + 2, y + 3, 1, 1))
Catch
End Try
Next
Next
End Sub
End Class
'
'
'Created By Marvinn (HF)
'Need Any help feel free to mail/pm me ([email protected])
'Please give propper credits!
'15/5/2011 16:30 (Dutch/Netherlands)
'Updated Seperator, Property's: Thickness, Style(Vertical, Horizontal)
'
'
Public Class CypherxButton
Inherits Control
Dim T As Timer
Sub New()
Font = New Font("Arial", 8)
ForeColor = FC
T = New Timer
T.Interval = _time / 10
AddHandler T.Tick, AddressOf FadeIn
End Sub
Dim _time As Integer = 200
Public Property FadeInTime() As Integer
Get
Return _time
End Get
Set(ByVal value As Integer)
_time = value
T.Interval = value / 10
End Set
End Property
Dim last As Integer = 0
Dim alpha As Integer = 0
Sub FadeIn()
If alpha = 255 Then
T.Stop()
Exit Sub
End If
alpha = CalculateAlpha(last)
Invalidate()
last += 10
End Sub
Function CalculateAlpha(ByVal Opacity As Integer) As Integer
Return (255 / 100) * Opacity
End Function
Private Enum State
MouseDown
MouseEnter
MouseLeft
End Enum
Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
MouseState = State.MouseLeft
Invalidate()
End Sub
Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
MouseState = State.MouseEnter
alpha = 0
last = 0
T.Start()
End Sub
Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
MouseState = State.MouseEnter
alpha = 255
Invalidate()
MyBase.OnMouseDown(e)
End Sub
Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
alpha = 255
Invalidate()
End Sub
Dim GC1 As Color = Color.FromArgb(75, 75, 75)
Dim GC2 As Color = Color.FromArgb(65, 65, 65)
Dim GC3 As Color = Color.FromArgb(63, 63, 63)
Dim GC4 As Color = Color.FromArgb(100, 100, 100)
Dim GC5 As Color = Color.FromArgb(130, 130, 130)
Dim GC6 As Color = Color.FromArgb(120, 120, 120)
Dim PC1 As Color = Color.FromArgb(50, 50, 50)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Dim P As Pen
Dim MouseState As State = State.MouseLeft
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
Dim OuterR As New Rectangle(0, 0, Width - 1, Height - 1)
Dim InnerR As New Rectangle(1, 1, Width - 3, Height - 3)
Dim UpHalf As New Rectangle(0, 0, Width, (Height - 1) / 2)
Dim DownHalf As New Rectangle(0, (Height - 2) / 2, Width, (Height - 1) / 2)
Select Case MouseState
Case State.MouseLeft
Draw.Gradient(g, GC1, GC2, UpHalf)
Draw.Gradient(g, GC3, GC2, DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
ForeColor = FC
Case State.MouseEnter
If alpha < 255 Then
Draw.Gradient(g, GC1, GC2, UpHalf)
Draw.Gradient(g, GC3, GC2, DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
End If
Draw.Gradient(g, Color.FromArgb(alpha, GC5), Color.FromArgb(alpha, GC6), UpHalf)
Draw.Gradient(g, Color.FromArgb(alpha, GC4), Color.FromArgb(alpha, GC6), DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
ForeColor = Color.FromArgb(23, 32, 37)
End Select
Dim S As SizeF = g.MeasureString(Text, Font)
g.DrawString(Text, Font, New SolidBrush(ForeColor), CInt(Width \ 2 - S.Width \ 2), CInt(Height \ 2 - S.Height \ 2))
e.Graphics.DrawImage(b.Clone, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
End Sub
End Class
Public Class CypherxTheme
Inherits Control
Dim needtopaintbg As Boolean = True
Protected Overrides Sub OnHandleCreated(ByVal e As System.EventArgs)
'Dock = DockStyle.Fill
'DoubleBuffered = True
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
.FormBorderStyle = 0
.BackColor = BgC
.ForeColor = Color.White
.Font = New Font("Arial", 8)
Font = .Font
ForeColor = .ForeColor
Text = .Text
_Icon = .Icon
End With
End If
End Sub
Sub New()
Dock = DockStyle.Fill
DoubleBuffered = True
End Sub
Protected Overrides Sub OnSizeChanged(ByVal e As System.EventArgs)
Invalidate()
MyBase.OnSizeChanged(e)
End Sub
Dim Balk As New Rectangle(4, 4, Width - 8, 27)
Dim BgC As Color = Color.FromArgb(28, 28, 28)
Dim Br As SolidBrush
Dim PC1 As Color = Color.FromArgb(50, 50, 50)
Dim PC2 As Color = Color.FromArgb(66, 66, 66)
Dim PC3 As Color = Color.FromArgb(79, 79, 79)
Dim BC1 As Color = Color.FromArgb(86, 86, 86)
Dim BC2 As Color = Color.FromArgb(71, 71, 71)
Dim P As Pen
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
Br = New SolidBrush(BgC)
g.FillRectangle(Br, New Rectangle(0, 0, Width, Height))
P = New Pen(PC1)
g.DrawRectangle(P, New Rectangle(0, 0, Width - 2, Height - 1))
P = New Pen(PC2)
g.DrawRectangle(P, New Rectangle(1, 1, Width - 3, Height - 3))
P = New Pen(PC3, 2)
g.DrawRectangle(P, New Rectangle(3, 3, Width - 6, Height - 6))
Dim BovenHelftBalk As New Rectangle(4, 4, Width - 8, CInt(27 / 2))
Dim OnderHelftBalk As New Rectangle(4, CInt(27 / 2) + 2, Width - 8, CInt(27 / 2))
g.FillRectangle(New SolidBrush(Color.FromArgb(200, BC1)), BovenHelftBalk)
g.FillRectangle(New SolidBrush(Color.FromArgb(150, BC2)), OnderHelftBalk)
g.DrawImage(ResizeIcon, New Rectangle(10, 10, 16, 16))
Dim S = g.MeasureString(Text, Font)
g.DrawString(Text, New Font("Arial", 8, FontStyle.Bold), New SolidBrush(ForeColor), 36, 10)
Dim MinimizeRec As New Rectangle(Width - 32, 16, 9, 5)
If Minibox Then
Select Case EnteredMinimize
Case True
g.FillRectangle(Brushes.White, MinimizeRec)
g.DrawRectangle(New Pen(Color.FromArgb(255, Color.Black), 1), MinimizeRec)
Case False
g.FillRectangle(New SolidBrush(Color.FromArgb(100, Color.White)), MinimizeRec)
g.DrawRectangle(New Pen(Color.FromArgb(150, Color.Black), 1), MinimizeRec)
End Select
End If
Select Case EntredClose
Case True
g.DrawString("x", New Font("Arial", 13, FontStyle.Bold), Brushes.White, Width - 20, 5)
Case False
Br = New SolidBrush(Color.FromArgb(100, Color.White))
g.DrawString("x", New Font("Arial", 13, FontStyle.Bold), Br, Width - 20, 5)
End Select
e.Graphics.DrawImage(b, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
Dim EnteredMinimize As Boolean = False
Dim EntredClose As Boolean = False
Function IconCheck() As Boolean
Try
If Icon.Width > 0 Then
Return True
Else
Return False
End If
Catch ex As Exception
Return False
End Try
End Function
Function ResizeIcon() As Bitmap
If Not IconCheck() Then
Try
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
_Icon = .Icon
End With
End If
Catch ex As Exception
End Try
End If
Try
Dim TempIcon As Icon = _Icon
Dim TempBitmap As Bitmap = New Bitmap(32, 32)
Dim BitmapGraphic As Graphics = Graphics.FromImage(TempBitmap)
Dim XPos, YPos As Integer
XPos = (TempBitmap.Width - TempIcon.Width) \ 2
YPos = (TempBitmap.Height - TempIcon.Height) \ 2
BitmapGraphic.DrawIcon(TempIcon, New Rectangle(XPos, YPos, TempIcon.Width, TempIcon.Height))
Return TempBitmap
Catch ex As Exception
Return _Icon.ToBitmap
End Try
End Function
Dim _Icon As Icon
Public Property Icon() As Icon
Get
Return _Icon
End Get
Set(ByVal value As Icon)
_Icon = value
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
.Icon = value
_Icon = value
Invalidate()
End With
End If
End Set
End Property
Dim FadingOut As Boolean = True
Public Property UseFadeOut() As Boolean
Get
Return FadingOut
End Get
Set(ByVal value As Boolean)
FadingOut = value
End Set
End Property
Dim Minibox As Boolean = True
Public Property MinimizeBox() As Boolean
Get
Return Minibox
End Get
Set(ByVal value As Boolean)
Minibox = value
Invalidate()
End Set
End Property
#Region " Global Variables "
Dim Point As New Point()
Dim X, Y As Integer
#End Region
#Region " GUI "
Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)
Dim Last As Boolean = EnteredMinimize
Dim MinimizeRec As New Rectangle(Width - 32, 16, 9, 5)
If MinimizeRec.Contains(e.Location) Then
EnteredMinimize = True
Else
EnteredMinimize = False
End If
If Not Last = EnteredMinimize Then
Invalidate()
End If
Last = EntredClose
Dim CloseRec As New Rectangle(Width - 20, 5, 16, 16)
If CloseRec.Contains(e.Location) Then
EntredClose = True
Else
EntredClose = False
End If
If Not Last = EntredClose Then
Invalidate()
End If
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
If e.Button = MouseButtons.Left And e.Location.X < Width And e.Location.Y < Balk.Height Then
Point = Control.MousePosition
Point.X = Point.X - (X)
Point.Y = Point.Y - (Y)
.Location = Point
End If
End With
End If
MyBase.OnMouseMove(e)
End Sub
Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
X = Control.MousePosition.X - .Location.X
Y = Control.MousePosition.Y - .Location.Y
End With
End If
Dim MinimizeRec As New Rectangle(Width - 32, 16, 9, 5)
If MinimizeRec.Contains(e.Location) Then
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
.WindowState = FormWindowState.Minimized
End With
End If
End If
Dim CloseRec As New Rectangle(Width - 20, 5, 16, 16)
If CloseRec.Contains(e.Location) Then
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
If FadingOut Then FadeOut()
.Close()
End With
End If
End If
MyBase.OnMouseDown(e)
End Sub
#End Region
Function FadeOut()
If TypeOf Parent Is Form Then
With DirectCast(Parent, Form)
For i As Double = 1 To 0.0 Step -0.1
.Opacity = i
Threading.Thread.Sleep(50)
Next
End With
End If
Return True
End Function
End Class
Public Class CypherxLabel
Inherits Label
Dim FC As Color = Color.FromArgb(124, 195, 255)
Sub New()
Font = New Font("Arial", 8)
ForeColor = FC
BackColor = Color.Transparent
End Sub
End Class
Public Class CyperxProgressbar
Inherits Control
Sub New()
Font = New Font("Arial", 8)
ForeColor = Color.White
End Sub
Dim _UseColor As Boolean = False
Public Property Colorize() As Boolean
Get
Return _UseColor
End Get
Set(ByVal value As Boolean)
_UseColor = value
Invalidate()
End Set
End Property
Dim Perc As Double = 0
Public ReadOnly Property Percentage() As Double
Get
Return Perc
End Get
End Property
Dim BC1 As Color = Color.FromArgb(90, 90, 90)
Dim BC2 As Color = Color.FromArgb(71, 71, 71)
Dim PC1 As Color = Color.FromArgb(50, 50, 50)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
Dim WholeR As New Rectangle(0, 0, Width - 1, Height - 1)
Draw.Gradient(g, _Lightcolor, _DarkColor, WholeR)
g.DrawRectangle(Pens.Black, WholeR)
Dim OneProcent As Double = Maximum / 100
Dim ProgressProcent As Integer = _Progress / OneProcent
Console.WriteLine(ProgressProcent)
Dim ProgressRec As New Rectangle(2, 2, CInt((Width - 4) * (ProgressProcent * 0.01)), Height - 4)
Perc = _Progress / (Maximum / 100)
Select Case _UseColor
Case False
g.FillRectangle(New SolidBrush(Color.FromArgb(100, Color.Black)), ProgressRec)
Case True
Dim Drawcolor As Color = Color.FromArgb(150, 255 - 2 * ProgressProcent, (1.7 * ProgressProcent), 0)
g.FillRectangle(New SolidBrush(Color.FromArgb(50, Drawcolor)), ProgressRec)
End Select
If Showt Then g.DrawString(Text, Font, New SolidBrush(ForeColor), New Point(3, 4))
e.Graphics.DrawImage(b, 0, 0)
End Using
End Using
End Sub
Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
End Sub
#Region " Properties "
Dim Showt As Boolean = True
Public Property ShowText() As Boolean
Get
Return Showt
End Get
Set(ByVal value As Boolean)
Showt = value
Invalidate()
End Set
End Property
Private _Maximum As Double = 100
Public Property Maximum() As Double
Get
Return _Maximum
End Get
Set(ByVal value As Double)
_Maximum = value
value = _Current / value * 100
Invalidate()
End Set
End Property
Private _Current As Double
Public Property Current() As Double
Get
Return _Current
End Get
Set(ByVal value As Double)
_Current = value
value = value / _Maximum * 100
Invalidate()
End Set
End Property
Private _Progress As Integer
Public Property Value() As Double
Get
Return _Progress
End Get
Set(ByVal value As Double)
If value < 0 Then value = 0 Else If value > Maximum Then value = Maximum
_Progress = CInt(value)
_Current = value * 0.01 * _Maximum
Invalidate()
End Set
End Property
Public Property DarkColor() As Color
Get
Return _DarkColor
End Get
Set(ByVal value As Color)
_DarkColor = value
Invalidate()
End Set
End Property
Public Property Lightcolor() As Color
Get
Return _Lightcolor
End Get
Set(ByVal value As Color)
_Lightcolor = value
Invalidate()
End Set
End Property
#End Region
#Region " Colors "
Dim _Lightcolor As Color = BC2
Dim _DarkColor = BC1
#End Region
End Class
Public Class CyperxTextbox
Inherits Control
Dim Bg As Color = Color.FromArgb(28, 28, 28)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Dim tbox As TextBox
Sub New()
Me.Text = ""
tbox = Nothing
tbox = New TextBox
tbox.Text = Text
tbox.BorderStyle = BorderStyle.None
tbox.BackColor = Bg
tbox.Location = New Point(3, 4)
tbox.Width = Width - 7
tbox.Font = Font
tbox.UseSystemPasswordChar = Pwbox
tbox.ForeColor = FC
Me.Controls.Add(tbox)
AddHandler tbox.TextChanged, AddressOf TextChange
End Sub
Dim Pwbox As Boolean = False
Dim DrawRounded As Boolean = True
Public Property Rounded() As Boolean
Get
Return DrawRounded
End Get
Set(ByVal value As Boolean)
DrawRounded = value
End Set
End Property
Public Property UseSystemPasswordChar() As Boolean
Get
Return Pwbox
End Get
Set(ByVal value As Boolean)
Pwbox = value
tbox = Nothing
tbox = New TextBox
tbox.Text = Text
tbox.BorderStyle = BorderStyle.None
tbox.BackColor = Bg
tbox.Location = New Point(3, 4)
tbox.Width = Width - 7
tbox.Font = Font
tbox.UseSystemPasswordChar = Pwbox
tbox.ForeColor = FC
Me.Controls.Add(tbox)
AddHandler tbox.TextChanged, AddressOf TextChange
End Set
End Property
Private Sub TextChange()
Me.Text = tbox.Text
End Sub
Dim p As Pen
Dim sb As SolidBrush
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
sb = New SolidBrush(Bg)
g.FillRectangle(sb, New Rectangle(0, 0, Width, Height))
p = New Pen(PC2)
If DrawRounded Then
Dim Outline As GraphicsPath = Draw.RoundedRectangle(0, 0, Width - 1, Height - 1, 10, 1)
g.DrawPath(p, Outline)
Else
Dim rec As New Rectangle(0, 0, Width - 1, Height - 1)
g.DrawRectangle(p, rec)
End If
e.Graphics.DrawImage(b, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
End Class
Public Class CypherxGroupBox
Inherits Panel
Dim Bg As Color = Color.FromArgb(28, 28, 28)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Dim p As Pen
Dim sb As SolidBrush
Sub New()
BackColor = Bg
End Sub
Dim _t As String = ""
Public Property Header() As String
Get
Return _t
End Get
Set(ByVal value As String)
_t = value
Invalidate()
End Set
End Property
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
p = New Pen(PC2)
sb = New SolidBrush(Bg)
Dim M As SizeF = g.MeasureString(_t, Font)
Dim Outline As GraphicsPath = Draw.RoundedRectangle(0, M.Height / 2, Width - 1, Height - 1, 10, 1)
g.Clear(BackColor)
g.FillRectangle(sb, New Rectangle(0, M.Height / 2, Width - 1, Height - 1))
g.DrawPath(p, Outline)
g.FillRectangle(sb, New Rectangle(10, (M.Height / 2) - 2, M.Width + 10, M.Height))
sb = New SolidBrush(FC)
g.DrawString(_t, Font, sb, 12, 2)
e.Graphics.DrawImage(b, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
End Class
Public Class CyperxSeperator
Inherits Control
Dim Bg As Color = Color.FromArgb(28, 28, 28)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Dim p As Pen
Dim sb As SolidBrush
Public Enum Direction
Horizontal
Vertical
End Enum
Dim Dir As Direction = Direction.Horizontal
Public Property Style() As DIRECTION
Get
Return Dir
End Get
Set(ByVal value As DIRECTION)
Dir = value
Invalidate()
End Set
End Property
Dim H As Integer = 2
Public Property Thickness() As Integer
Get
Return H
End Get
Set(ByVal value As Integer)
H = value
Invalidate()
End Set
End Property
Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
End Sub
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
g.Clear(BackColor)
sb = New SolidBrush(Bg)
g.FillRectangle(sb, New Rectangle(0, 0, Width, Height))
Select Case Dir
Case Direction.Horizontal
Dim GRec As New Rectangle(0, Height / 2, Width / 5, H)
Using GBrush As LinearGradientBrush = New LinearGradientBrush(GRec, Color.Transparent, FC, LinearGradientMode.Horizontal)
g.FillRectangle(GBrush, GRec)
End Using
p = New Pen(FC, H)
Dim x As Integer = Math.Floor(H / 2)
g.DrawLine(p, New Point(GRec.Width, GRec.Y + x), New Point(Width - GRec.Width + 1, GRec.Y + x))
GRec = New Rectangle(Width - (Width / 5), Height / 2, Width / 5, H)
Using GBrush As LinearGradientBrush = New LinearGradientBrush(GRec, FC, Color.Transparent, LinearGradientMode.Horizontal)
g.FillRectangle(GBrush, GRec)
End Using
Case Direction.Vertical
Dim GRec As New Rectangle(Width / 2, 0, H, Height / 5)
Using GBrush As LinearGradientBrush = New LinearGradientBrush(GRec, Color.Transparent, FC, LinearGradientMode.Vertical)
g.FillRectangle(GBrush, GRec)
End Using
p = New Pen(FC, H)
Dim x As Integer = Math.Floor(H / 2)
g.DrawLine(p, New Point(GRec.X + x, Height / 5), New Point(GRec.X + x, Height - (Height / 5)))
GRec = New Rectangle(GRec.X, Height - (Height / 5) - 1, H, Height / 5)
Using GBrush As LinearGradientBrush = New LinearGradientBrush(GRec, FC, Color.Transparent, LinearGradientMode.Vertical)
g.FillRectangle(GBrush, GRec)
End Using
End Select
e.Graphics.DrawImage(b, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
End Class
Public Class CyperxComboBox
Inherits Control
Dim t As Timer
Sub New()
Font = New Font("Arial", 8)
ForeColor = Color.White
MinimumSize = New Size(130, 23)
t = New Timer
t.Interval = _time / 10
AddHandler t.Tick, AddressOf FadeIn
End Sub
Dim _time As Integer = 200
Public Property FadeInTime() As Integer
Get
Return _time
End Get
Set(ByVal value As Integer)
_time = value
t.Interval = value / 10
End Set
End Property
Dim last As Integer = 0
Dim alpha As Integer = 0
Sub FadeIn()
If alpha = 255 Then
T.Stop()
Exit Sub
End If
alpha = CalculateAlpha(last)
Invalidate()
last += 10
End Sub
Function CalculateAlpha(ByVal Opacity As Integer) As Integer
Return (255 / 100) * Opacity
End Function
Dim LastItems() As String
Protected Overrides Sub OnHandleCreated(ByVal e As System.EventArgs)
Try
If _Items.Length = 0 Then _Items = New String() {Text}
Catch ex As Exception
_Items = New String() {Text}
End Try
LastItems = _Items
pop = New Popup(_Items)
pop.Location = New Point(Location.X, Location.Y + Height + 2)
pop.Visible = False
Invoke(New AddX(AddressOf AddControl), pop)
MyBase.OnHandleCreated(e)
End Sub
Private Enum State
MouseDown = 0
MouseEnter = 1
MouseLeft = 2
Wait = 3
End Enum
Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
If Not MouseState = State.Wait Then
MouseState = State.MouseLeft
alpha = 0
last = 0
Invalidate()
End If
End Sub
Protected Overrides Sub OnMouseEnter(ByVal e As System.EventArgs)
If Not MouseState = State.Wait Then
MouseState = State.MouseEnter
t.Start()
End If
End Sub
Protected Overrides Sub OnMouseUp(ByVal e As System.Windows.Forms.MouseEventArgs)
If Not MouseState = State.Wait Then
MouseState = State.MouseEnter
Invalidate()
End If
End Sub
Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
MouseState = State.Wait
t.Stop()
alpha = 255
Dim ShowPopup As New Threading.Thread(AddressOf ShowAndWait)
ShowPopup.Start()
Invalidate()
MyBase.OnMouseDown(e)
End Sub
Dim pop As Popup
Delegate Sub ShowPopD(ByVal shown As Boolean)
Sub ShowPop(ByVal show As Boolean)
pop.Visible = show
End Sub
Sub ShowAndWait()
If pop.Showing Then Exit Sub
pop = Nothing
pop = New Popup(_Items)
pop.Location = New Point(Location.X, Location.Y + Height + 2)
Invoke(New AddX(AddressOf AddControl), pop)
pop.WaitForInput()
alpha = 0
last = 0
MouseState = State.MouseLeft
If Not pop.SelectedItem = "" Then
Invoke(New UpdateTextD(AddressOf UpdateText), pop.SelectedItem)
Else
Invoke(New UpdateTextD(AddressOf UpdateText), Text)
End If
End Sub
Delegate Sub UpdateTextD(ByVal text As String)
Sub UpdateText(ByVal text As String)
Me.Text = text
Invalidate()
End Sub
Delegate Sub AddX(ByVal control As Control)
Sub AddControl(ByVal control As Control)
Parent.Controls.Add(control)
End Sub
Dim _Items() As String
Public Property Items() As String()
Get
Return _Items
End Get
Set(ByVal value As String())
_Items = value
Invalidate()
End Set
End Property
Dim MouseState As State = State.MouseLeft
Dim GC1 As Color = Color.FromArgb(75, 75, 75)
Dim GC2 As Color = Color.FromArgb(65, 65, 65)
Dim GC3 As Color = Color.FromArgb(63, 63, 63)
Dim GC4 As Color = Color.FromArgb(100, 100, 100)
Dim GC5 As Color = Color.FromArgb(130, 130, 130)
Dim GC6 As Color = Color.FromArgb(120, 120, 120)
Dim PC1 As Color = Color.FromArgb(50, 50, 50)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Dim P As Pen
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
Dim OuterR As New Rectangle(0, 0, Width - 1, Height - 1)
Dim InnerR As New Rectangle(1, 1, Width - 3, Height - 3)
Dim UpHalf As New Rectangle(2, 2, Width - 3, (Height - 1) / 2)
Dim DownHalf As New Rectangle(2, (Height - 1) / 2, Width - 3, (Height - 1) / 2)
Select Case MouseState
Case State.MouseLeft
Draw.Gradient(g, GC1, GC2, UpHalf)
Draw.Gradient(g, GC3, GC2, DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
ForeColor = FC
Case State.MouseEnter
If alpha < 255 Then
Draw.Gradient(g, GC1, GC2, UpHalf)
Draw.Gradient(g, GC3, GC2, DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
End If
Draw.Gradient(g, Color.FromArgb(alpha, GC5), Color.FromArgb(alpha, GC6), UpHalf)
Draw.Gradient(g, Color.FromArgb(alpha, GC4), Color.FromArgb(alpha, GC6), DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
ForeColor = Color.FromArgb(23, 32, 37)
Case State.Wait
Draw.Gradient(g, Color.FromArgb(alpha, GC5), Color.FromArgb(alpha, GC6), UpHalf)
Draw.Gradient(g, Color.FromArgb(alpha, GC4), Color.FromArgb(alpha, GC6), DownHalf)
P = New Pen(PC1)
g.DrawRectangle(P, OuterR)
P = New Pen(PC2)
g.DrawRectangle(P, InnerR)
ForeColor = Color.FromArgb(23, 32, 37)
End Select
If ShowS Then
Dim UpRec As New Rectangle(Width - 18, 2, 1, 5)
Draw.Gradient(g, Color.Transparent, PC2, UpRec)
P = New Pen(PC2)
g.DrawLine(P, New Point(Width - 18, 7), New Point(Width - 18, Height - 7))
Draw.Gradient(g, PC2, Color.Transparent, New Rectangle(Width - 18, Height - 7, 1, 5))
End If
P = New Pen(Brushes.White, 2)
g.DrawLine(P, New Point(Width - 15, 9), New Point(Width - 10, 14))
g.DrawLine(P, New Point(Width - 5, 9), New Point(Width - 10, 14))
Dim S As SizeF = g.MeasureString(Text, Font)
g.DrawString(Text, Font, New SolidBrush(ForeColor), 5, CInt(Height / 2 - S.Height / 2))
e.Graphics.DrawImage(b.Clone, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
Dim ShowS As Boolean = True
Public Property ShowSeperator() As Boolean
Get
Return ShowS
End Get
Set(ByVal value As Boolean)
ShowS = value
Invalidate()
End Set
End Property
Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
End Sub
End Class
Public Class Popup
Inherits Control
Dim _items() As String
Dim ListOfRec As New List(Of Rectangle)
Sub New()
Throw New Exception("You can't add this direct to the Designer!")
End Sub
Sub New(ByVal items As String())
DoubleBuffered = True
_items = items
FixWidth()
FixList()
End Sub
Protected Overrides Sub OnHandleCreated(ByVal e As System.EventArgs)
Console.WriteLine(TopLevelControl.TopLevelControl)
BringToFront()
Shown = True
MyBase.OnHandleCreated(e)
End Sub
Dim MyMousedown As Boolean = False
Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
MyMousedown = True
Invalidate()
_item = Temp_item
Console.WriteLine("Item: " & SelectedItem)
Input = True
Shown = False
Visible = False
MyBase.OnMouseDown(e)
End Sub
Sub FixWidth()
Dim G As Graphics = Graphics.FromImage(New Bitmap(1, 1))
Dim LongestWidth As Integer = 0
For Each Str As String In _items
If G.MeasureString(Str, Font).Width > LongestWidth Then
LongestWidth = G.MeasureString(Str, Font).Width
End If
Next
If LongestWidth < 85 Then
Width = 95
Else
Me.Width = LongestWidth + 9
End If
End Sub
Dim Shown As Boolean = False
Public ReadOnly Property Showing() As Boolean
Get
Return Shown
End Get
End Property
Sub FixList()
Dim MyHeight = 23 * _items.Length - 1
Dim AantalRecs As Integer = MyHeight / 23
ListOfRec.Add(New Rectangle(2, 3, Width - 5, 23))
For i As Integer = 1 To AantalRecs
Dim rec As New Rectangle(2, 23 * i, Width - 5, 23)
ListOfRec.Add(rec)
Next
Me.Height = MyHeight + 5
Invalidate()
End Sub
Dim SelectedReg As New Rectangle(0, 0, 0, 0)
Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)
Dim Oldrec As Rectangle = SelectedReg
For Each rec As Rectangle In ListOfRec
If rec.Contains(e.Location) Then
SelectedReg = rec
End If
Next
If Not Oldrec = SelectedReg Then
Invalidate()
End If
MyBase.OnMouseMove(e)
End Sub
Dim Input As Boolean = False
Public Sub WaitForInput()
Do While Input = False
Threading.Thread.Sleep(1)
Loop
End Sub
Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs)
SelectedReg = New Rectangle(0, 0, 0, 0)
Me.Visible = False
Input = True
Shown = False
MyBase.OnMouseLeave(e)
End Sub
Dim _item As String = ""
Public Property SelectedItem() As String
Get
Return _item
End Get
Set(ByVal value As String)
_item = value
End Set
End Property
Dim BC1 As Color = Color.FromArgb(90, 90, 90)
Dim BC2 As Color = Color.FromArgb(71, 71, 71)
Dim PC1 As Color = Color.FromArgb(50, 50, 50)
Dim PC2 As Color = Color.FromArgb(83, 83, 83)
Dim FC As Color = Color.FromArgb(124, 195, 255)
Dim SB As SolidBrush
Dim p As Pen
Dim Temp_item As String = ""
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Using b As New Bitmap(Width, Height)
Using g As Graphics = Graphics.FromImage(b)
Dim Fullrec As New Rectangle(0, 0, Width - 1, Height - 1)
SB = New SolidBrush(BC2)
p = New Pen(PC2)
g.FillRectangle(SB, Fullrec)
g.DrawRectangle(p, Fullrec)
SB = New SolidBrush(BC1)
g.FillRectangle(SB, SelectedReg)
p = New Pen(FC)
g.DrawRectangle(p, SelectedReg)
If SelectedReg.Contains(New Point(5, 5)) Then
SB = New SolidBrush(FC)
g.DrawString(_items(0), Font, SB, 5, 7)
Console.WriteLine("Selected item " & _items(0))
Temp_item = _items(0)
Else
g.DrawString(_items(0), Font, Brushes.White, 5, 7)
End If
For I As Integer = 1 To _items.Length - 1
If SelectedReg.Contains(New Point(5, I * 23 + 5)) Then
SB = New SolidBrush(FC)
g.DrawString(_items(I), Font, SB, 5, I * 23 + 5)
Console.WriteLine("Selected item: " & _items(I))
Temp_item = _items(I)
Else
g.DrawString(_items(I), Font, Brushes.White, 5, I * 23 + 5)
End If
Next
e.Graphics.DrawImage(b, 0, 0)
End Using
End Using
MyBase.OnPaint(e)
End Sub
End Class
'
'
'Created By Aeonhack
'
'
Public Class Draw
Shared Sub Gradient(ByVal g As Graphics, ByVal c1 As Color, ByVal c2 As Color, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer)
Dim R As New Rectangle(x, y, width, height)
Using T As New LinearGradientBrush(R, c1, c2, LinearGradientMode.Vertical)
g.FillRectangle(T, R)
End Using
End Sub
Shared Sub Gradient(ByVal g As Graphics, ByVal c1 As Color, ByVal c2 As Color, ByVal r As Rectangle)
Using T As New LinearGradientBrush(R, c1, c2, LinearGradientMode.Vertical)
g.FillRectangle(T, R)
End Using
End Sub
Shared Sub Blend(ByVal g As Graphics, ByVal c1 As Color, ByVal c2 As Color, ByVal c3 As Color, ByVal c As Single, ByVal d As Integer, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer)
Dim v As New ColorBlend(3)
V.Colors = New Color() {c1, c2, c3}
V.Positions = New Single() {0, c, 1}
Dim R As New Rectangle(x, y, width, height)
Using T As New LinearGradientBrush(R, c1, c1, CType(d, LinearGradientMode))
T.InterpolationColors = v : g.FillRectangle(T, R)
End Using
End Sub
Shared Function RoundedRectangle(ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal cornerwidth As Integer, ByVal PenWidth As Integer) As GraphicsPath
Dim p As New GraphicsPath
p.StartFigure()
p.AddArc(New Rectangle(x, y, cornerwidth, cornerwidth), 180, 90)
p.AddLine(cornerwidth, y, width - cornerwidth - PenWidth, y)
p.AddArc(New Rectangle(width - cornerwidth - PenWidth, y, cornerwidth, cornerwidth), -90, 90)
p.AddLine(width - PenWidth, cornerwidth, width - PenWidth, height - cornerwidth - PenWidth)
p.AddArc(New Rectangle(width - cornerwidth - PenWidth, height - cornerwidth - PenWidth, cornerwidth, cornerwidth), 0, 90)
p.AddLine(width - cornerwidth - PenWidth, height - PenWidth, cornerwidth, height - PenWidth)
p.AddArc(New Rectangle(x, height - cornerwidth - PenWidth, cornerwidth, cornerwidth), 90, 90)
p.CloseFigure()
Return p
End Function
Shared Sub BackGround(ByVal width As Integer, ByVal height As Integer, ByVal G As Graphics)
Dim P1 As Color = Color.FromArgb(29, 25, 22)
Dim P2 As Color = Color.FromArgb(35, 31, 28)
For y As Integer = 0 To height Step 4
For x As Integer = 0 To width Step 4
G.FillRectangle(New SolidBrush(P1), New Rectangle(x, y, 1, 1))
G.FillRectangle(New SolidBrush(P2), New Rectangle(x, y + 1, 1, 1))
Try
G.FillRectangle(New SolidBrush(P1), New Rectangle(x + 2, y + 2, 1, 1))
G.FillRectangle(New SolidBrush(P2), New Rectangle(x + 2, y + 3, 1, 1))
Catch
End Try
Next
Next
End Sub
End Class
Voila donc un screen du rendu :
Ce lien n'est pas visible, veuillez vous connecter pour l'afficher. Je m'inscris!
TÉLÉCHARGEMENT: Ce lien n'est pas visible, veuillez vous connecter pour l'afficher. Je m'inscris!
Voila a +
Last edited: