Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub PanelGenre_Paint(sender As System.Object, e As System.Windows.Forms.PaintEventArgs) Handles PanelGenre.Paint
- Dim cmp As Integer = 2
- Dim libelle(2) As String
- libelle(0) = "MR"
- libelle(1) = "MME"
- libelle(2) = "MLLE"
- For Each but As RadioButton In PanelGenre.Controls
- but.Text = libelle(cmp)
- cmp -= 1
- Next
- End Sub
- Private Sub RadioButton4_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton4.CheckedChanged
- If RadioButton4.Checked = True Then
- PanelCode.Visible = True
- TextBoxCode.Focus()
- Else
- PanelCode.Visible = False
- End If
- End Sub
- Private Sub RadioButton5_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton5.CheckedChanged
- PanelPays.Visible = Not (PanelPays.Visible)
- If PanelPays.Visible = True Then
- TextBoxPays.Focus()
- End If
- End Sub
- Private Sub valid_Click(sender As System.Object, e As System.EventArgs) Handles valid.Click
- If TextBoxCode.TextLength <> 5 OrElse (TextBoxCode.Text(0) = "0" And TextBoxCode.Text(1) = "0") Then
- CodePost.BackColor = Color.Red
- Else
- TextBoxCode.BackColor = Color.White
- End If
- End Sub
- Private Sub TextBoxCode_KeyPress(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBoxCode.KeyPress
- If e.KeyChar < "0" Or e.KeyChar > "9" Then
- If e.KeyChar <> ControlChars.Back Then
- e.Handled = True
- End If
- End If
- End Sub
- Private Sub TextBoxNom_KeyPress(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBoxNom.KeyPress
- e.Handled = VerifNotAlpha(e.KeyChar)
- End Sub
- Private Sub TextBoxPrenom_KeyPress(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBoxPrenom.KeyPress
- e.Handled = VerifNotAlpha(e.KeyChar)
- End Sub
- Private Sub TextBox_KeyPress(sender As System.Object, e As System.Windows.Forms.KeyPressEventArgs) Handles TextBoxPays.KeyPress ', TextBoxPrenom.KeyPress, TextBoxNom.KeyPress
- e.Handled = VerifNotAlpha(e.KeyChar)
- End Sub
- Function VerifNotAlpha(c As Char)
- If Not Char.IsLetter(c) And c <> vbBack Then
- Return True
- End If
- Return False
- End Function
- Private Sub arret_Click(sender As System.Object, e As System.EventArgs) Handles arret.Click
- Dim reponse As MsgBoxResult
- reponse = MsgBox("Voulez vous vraiment quitter ?", MsgBoxStyle.YesNo)
- If reponse = MsgBoxResult.Yes Then
- End
- End If
- End Sub
- Private Sub TextBox_LostFocus(sender As Object, e As System.EventArgs) Handles TextBoxNom.LostFocus, TextBoxPays.LostFocus, TextBoxPrenom.LostFocus
- sender.Text = UCase(sender.Text)
- End Sub
- End Class
- <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()
- Me.RadioButton1 = New System.Windows.Forms.RadioButton()
- Me.RadioButton2 = New System.Windows.Forms.RadioButton()
- Me.RadioButton3 = New System.Windows.Forms.RadioButton()
- Me.RadioButton4 = New System.Windows.Forms.RadioButton()
- Me.RadioButton5 = New System.Windows.Forms.RadioButton()
- Me.Nom = New System.Windows.Forms.Label()
- Me.Prénom = New System.Windows.Forms.Label()
- Me.CodePost = New System.Windows.Forms.Label()
- Me.PanelGenre = New System.Windows.Forms.Panel()
- Me.Panel2 = New System.Windows.Forms.Panel()
- Me.PanelNom = New System.Windows.Forms.Panel()
- Me.TextBoxPrenom = New System.Windows.Forms.TextBox()
- Me.TextBoxNom = New System.Windows.Forms.TextBox()
- Me.PanelCode = New System.Windows.Forms.Panel()
- Me.TextBoxCode = New System.Windows.Forms.TextBox()
- Me.arret = New System.Windows.Forms.Button()
- Me.valid = New System.Windows.Forms.Button()
- Me.Pays = New System.Windows.Forms.Label()
- Me.TextBoxPays = New System.Windows.Forms.TextBox()
- Me.PanelPays = New System.Windows.Forms.Panel()
- Me.PanelGenre.SuspendLayout()
- Me.Panel2.SuspendLayout()
- Me.PanelNom.SuspendLayout()
- Me.PanelCode.SuspendLayout()
- Me.PanelPays.SuspendLayout()
- Me.SuspendLayout()
- '
- 'RadioButton1
- '
- Me.RadioButton1.AutoSize = True
- Me.RadioButton1.Location = New System.Drawing.Point(16, 12)
- Me.RadioButton1.Name = "RadioButton1"
- Me.RadioButton1.Size = New System.Drawing.Size(60, 17)
- Me.RadioButton1.TabIndex = 0
- Me.RadioButton1.TabStop = True
- Me.RadioButton1.Text = "option1"
- Me.RadioButton1.UseVisualStyleBackColor = True
- '
- 'RadioButton2
- '
- Me.RadioButton2.AutoSize = True
- Me.RadioButton2.Location = New System.Drawing.Point(16, 36)
- Me.RadioButton2.Name = "RadioButton2"
- Me.RadioButton2.Size = New System.Drawing.Size(60, 17)
- Me.RadioButton2.TabIndex = 1
- Me.RadioButton2.TabStop = True
- Me.RadioButton2.Text = "option1"
- Me.RadioButton2.UseVisualStyleBackColor = True
- '
- 'RadioButton3
- '
- Me.RadioButton3.AutoSize = True
- Me.RadioButton3.Location = New System.Drawing.Point(16, 60)
- Me.RadioButton3.Name = "RadioButton3"
- Me.RadioButton3.Size = New System.Drawing.Size(60, 17)
- Me.RadioButton3.TabIndex = 2
- Me.RadioButton3.TabStop = True
- Me.RadioButton3.Text = "option1"
- Me.RadioButton3.UseVisualStyleBackColor = True
- '
- 'RadioButton4
- '
- Me.RadioButton4.AutoSize = True
- Me.RadioButton4.Checked = True
- Me.RadioButton4.Location = New System.Drawing.Point(9, 11)
- Me.RadioButton4.Name = "RadioButton4"
- Me.RadioButton4.Size = New System.Drawing.Size(65, 17)
- Me.RadioButton4.TabIndex = 3
- Me.RadioButton4.TabStop = True
- Me.RadioButton4.Text = "Français"
- Me.RadioButton4.UseVisualStyleBackColor = True
- '
- 'RadioButton5
- '
- Me.RadioButton5.AutoSize = True
- Me.RadioButton5.Location = New System.Drawing.Point(9, 35)
- Me.RadioButton5.Name = "RadioButton5"
- Me.RadioButton5.Size = New System.Drawing.Size(65, 17)
- Me.RadioButton5.TabIndex = 4
- Me.RadioButton5.TabStop = True
- Me.RadioButton5.Text = "Étranger"
- Me.RadioButton5.UseVisualStyleBackColor = True
- '
- 'Nom
- '
- Me.Nom.AutoSize = True
- Me.Nom.Location = New System.Drawing.Point(12, 26)
- Me.Nom.Name = "Nom"
- Me.Nom.Size = New System.Drawing.Size(29, 13)
- Me.Nom.TabIndex = 5
- Me.Nom.Text = "Nom"
- '
- 'Prénom
- '
- Me.Prénom.AutoSize = True
- Me.Prénom.Location = New System.Drawing.Point(12, 52)
- Me.Prénom.Name = "Prénom"
- Me.Prénom.Size = New System.Drawing.Size(43, 13)
- Me.Prénom.TabIndex = 6
- Me.Prénom.Text = "Prénom"
- '
- 'CodePost
- '
- Me.CodePost.AutoSize = True
- Me.CodePost.Location = New System.Drawing.Point(13, 20)
- Me.CodePost.Name = "CodePost"
- Me.CodePost.Size = New System.Drawing.Size(64, 13)
- Me.CodePost.TabIndex = 9
- Me.CodePost.Text = "Code Postal"
- '
- 'PanelGenre
- '
- Me.PanelGenre.Controls.Add(Me.RadioButton3)
- Me.PanelGenre.Controls.Add(Me.RadioButton2)
- Me.PanelGenre.Controls.Add(Me.RadioButton1)
- Me.PanelGenre.Location = New System.Drawing.Point(95, 73)
- Me.PanelGenre.Name = "PanelGenre"
- Me.PanelGenre.Size = New System.Drawing.Size(121, 89)
- Me.PanelGenre.TabIndex = 11
- '
- 'Panel2
- '
- Me.Panel2.Controls.Add(Me.RadioButton5)
- Me.Panel2.Controls.Add(Me.RadioButton4)
- Me.Panel2.Location = New System.Drawing.Point(95, 183)
- Me.Panel2.Name = "Panel2"
- Me.Panel2.Size = New System.Drawing.Size(113, 60)
- Me.Panel2.TabIndex = 12
- '
- 'PanelNom
- '
- Me.PanelNom.Controls.Add(Me.TextBoxPrenom)
- Me.PanelNom.Controls.Add(Me.TextBoxNom)
- Me.PanelNom.Controls.Add(Me.Prénom)
- Me.PanelNom.Controls.Add(Me.Nom)
- Me.PanelNom.Location = New System.Drawing.Point(369, 73)
- Me.PanelNom.Name = "PanelNom"
- Me.PanelNom.Size = New System.Drawing.Size(199, 89)
- Me.PanelNom.TabIndex = 13
- '
- 'TextBoxPrenom
- '
- Me.TextBoxPrenom.Location = New System.Drawing.Point(100, 51)
- Me.TextBoxPrenom.Name = "TextBoxPrenom"
- Me.TextBoxPrenom.Size = New System.Drawing.Size(100, 20)
- Me.TextBoxPrenom.TabIndex = 8
- '
- 'TextBoxNom
- '
- Me.TextBoxNom.Location = New System.Drawing.Point(100, 26)
- Me.TextBoxNom.Name = "TextBoxNom"
- Me.TextBoxNom.Size = New System.Drawing.Size(100, 20)
- Me.TextBoxNom.TabIndex = 7
- '
- 'PanelCode
- '
- Me.PanelCode.Controls.Add(Me.TextBoxCode)
- Me.PanelCode.Controls.Add(Me.CodePost)
- Me.PanelCode.Location = New System.Drawing.Point(369, 183)
- Me.PanelCode.Name = "PanelCode"
- Me.PanelCode.Size = New System.Drawing.Size(201, 40)
- Me.PanelCode.TabIndex = 14
- '
- 'TextBoxCode
- '
- Me.TextBoxCode.Location = New System.Drawing.Point(98, 13)
- Me.TextBoxCode.MaxLength = 5
- Me.TextBoxCode.Name = "TextBoxCode"
- Me.TextBoxCode.Size = New System.Drawing.Size(100, 20)
- Me.TextBoxCode.TabIndex = 10
- '
- 'arret
- '
- Me.arret.Location = New System.Drawing.Point(104, 349)
- Me.arret.Name = "arret"
- Me.arret.Size = New System.Drawing.Size(75, 23)
- Me.arret.TabIndex = 15
- Me.arret.Text = "Arrêt"
- Me.arret.UseVisualStyleBackColor = True
- '
- 'valid
- '
- Me.valid.Location = New System.Drawing.Point(369, 349)
- Me.valid.Name = "valid"
- Me.valid.Size = New System.Drawing.Size(75, 23)
- Me.valid.TabIndex = 16
- Me.valid.Text = "Validation"
- Me.valid.UseVisualStyleBackColor = True
- '
- 'Pays
- '
- Me.Pays.AutoSize = True
- Me.Pays.Location = New System.Drawing.Point(13, 17)
- Me.Pays.Name = "Pays"
- Me.Pays.Size = New System.Drawing.Size(30, 13)
- Me.Pays.TabIndex = 17
- Me.Pays.Text = "Pays"
- '
- 'TextBoxPays
- '
- Me.TextBoxPays.Location = New System.Drawing.Point(100, 10)
- Me.TextBoxPays.Name = "TextBoxPays"
- Me.TextBoxPays.Size = New System.Drawing.Size(100, 20)
- Me.TextBoxPays.TabIndex = 18
- '
- 'PanelPays
- '
- Me.PanelPays.Controls.Add(Me.TextBoxPays)
- Me.PanelPays.Controls.Add(Me.Pays)
- Me.PanelPays.Location = New System.Drawing.Point(369, 229)
- Me.PanelPays.Name = "PanelPays"
- Me.PanelPays.Size = New System.Drawing.Size(201, 39)
- Me.PanelPays.TabIndex = 19
- Me.PanelPays.Visible = False
- '
- 'Form1
- '
- Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
- Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
- Me.ClientSize = New System.Drawing.Size(706, 448)
- Me.Controls.Add(Me.PanelPays)
- Me.Controls.Add(Me.valid)
- Me.Controls.Add(Me.arret)
- Me.Controls.Add(Me.PanelCode)
- Me.Controls.Add(Me.PanelNom)
- Me.Controls.Add(Me.Panel2)
- Me.Controls.Add(Me.PanelGenre)
- Me.Name = "Form1"
- Me.Text = "Form1"
- Me.PanelGenre.ResumeLayout(False)
- Me.PanelGenre.PerformLayout()
- Me.Panel2.ResumeLayout(False)
- Me.Panel2.PerformLayout()
- Me.PanelNom.ResumeLayout(False)
- Me.PanelNom.PerformLayout()
- Me.PanelCode.ResumeLayout(False)
- Me.PanelCode.PerformLayout()
- Me.PanelPays.ResumeLayout(False)
- Me.PanelPays.PerformLayout()
- Me.ResumeLayout(False)
- End Sub
- Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton
- Friend WithEvents RadioButton2 As System.Windows.Forms.RadioButton
- Friend WithEvents RadioButton3 As System.Windows.Forms.RadioButton
- Friend WithEvents RadioButton4 As System.Windows.Forms.RadioButton
- Friend WithEvents RadioButton5 As System.Windows.Forms.RadioButton
- Friend WithEvents Nom As System.Windows.Forms.Label
- Friend WithEvents Prénom As System.Windows.Forms.Label
- Friend WithEvents CodePost As System.Windows.Forms.Label
- Friend WithEvents PanelGenre As System.Windows.Forms.Panel
- Friend WithEvents Panel2 As System.Windows.Forms.Panel
- Friend WithEvents PanelNom As System.Windows.Forms.Panel
- Friend WithEvents TextBoxPrenom As System.Windows.Forms.TextBox
- Friend WithEvents TextBoxNom As System.Windows.Forms.TextBox
- Friend WithEvents PanelCode As System.Windows.Forms.Panel
- Friend WithEvents TextBoxCode As System.Windows.Forms.TextBox
- Friend WithEvents arret As System.Windows.Forms.Button
- Friend WithEvents valid As System.Windows.Forms.Button
- Friend WithEvents Pays As System.Windows.Forms.Label
- Friend WithEvents TextBoxPays As System.Windows.Forms.TextBox
- Friend WithEvents PanelPays As System.Windows.Forms.Panel
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement