1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
| Public Class Poeple
Dim G_Variable As GlobalVar.VariableGobale = New GlobalVar.VariableGobale
Dim GetData As DataControle.DataControle = New DataControle.DataControle
Dim CodePostal As ZipCode.ZipCodes = New ZipCode.ZipCodes
Dim ControleChamps As CheckFields.CheckFiled = New CheckFields.CheckFiled
Dim AjoutData As Boolean = False
Dim WithEvents TimerLbl As Timer = New Timer
Public DgContacts As DataGridView = New DataGridView
Private _Nom As String
Private _adresse1 As String
Private _Cp As String
Private Sub Poeple_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
With DgContacts
.RowCount = 20
.ColumnCount = 5
.Location = New Point(3, 3)
.RowHeadersVisible = False
.BackgroundColor = Color.White
.AlternatingRowsDefaultCellStyle.BackColor = Color.LightCyan
.ScrollBars = ScrollBars.Vertical
.Size = New Size(TbClients.Width - 13, TbClients.Height - .ColumnHeadersHeight - 5)
End With
Me.TbContacts.Controls.Add(DgContacts)
LoadComboBox()
End Sub
Private Sub TxtNom_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles TxtNom.KeyDown, TxtAdresse1.KeyDown, TxtCp.KeyDown
If e.KeyCode = Keys.Return Then SendKeys.Send("{TAB}")
End Sub
Private Sub LoadComboBox()
Dim DsPays As DataSet = New DataSet
DsPays = GetData.GetDatas("SELECT * FROM IsoCountry ORDER BY I_NameCountry", "IsoCountry", G_Variable.Connexion)
CbPays.Items.Clear()
CbPays.Items.Add("")
For Each rPays As DataRow In DsPays.Tables("IsoCountry").Rows
CbPays.Items.Add(Format(rPays("I_IsoCodeCountry"), "000") & " " & rPays("I_NameCountry").ToString.Trim)
Next
End Sub
Private Sub TxtNom_LostFocus(sender As Object, e As System.EventArgs) Handles TxtNom.LostFocus, TxtAdresse1.LostFocus, TxtCp.LostFocus
Select Case CType(sender, TextBox).Name
Case "TxtNom"
Nom = TxtNom.Text
TxtNom.Text = Nom
Case "TxtAdresse1"
Adresse1 = TxtAdresse1.Text
TxtAdresse1.Text = Adresse1
Case "TxtCp"
Cp = TxtCp.Text
TxtCp.Text = Cp
End Select
End Sub
Property Nom As String
Get
Return _Nom
End Get
Set(value As String)
_Nom = UCase(value)
End Set
End Property
Property Adresse1 As String
Get
Return _adresse1
End Get
Set(value As String)
_adresse1 = UCase(value)
End Set
End Property
Property Cp As String
Get
Return _Cp
End Get
Set(value As String)
_Cp = UCase(value)
End Set
End Property
End Class |
Partager