J'ai un projet en faire en vb dans le cadre de mon cours de prog. Le projet est fini mais pour que mon code soit accepté, il me faut un private sub personnalisé. Depuis une semaine, je ne dort pas en essayant de regler mon probleme. Je sais que sur développez on ne donne pas les solutions tout cuit dans le bec mais pouvez-vous m'aider?
voici mon code
Merci davance
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 If oct1.Length = 3 And CDbl(oct1) <= 9 Then ' Vérification si oct1 est soit 00#|0##|0# et adaptation du txtAddresse oct1 = oct1.Substring(2, 1) txtAddresse.Text = oct1 + "." + oct2 + "." + oct3 + "." + oct4 ElseIf oct1.Length = 3 And CDbl(oct1) >= 10 And CDbl(oct1) <= 99 Then oct1 = oct1.Substring(1, 2) txtAddresse.Text = oct1 + "." + oct2 + "." + oct3 + "." + oct4 ElseIf oct1.Length = 2 And CDbl(oct1) <= 9 Then oct1 = oct1.Substring(1, 1) txtAddresse.Text = oct1 + "." + oct2 + "." + oct3 + "." + oct4 End If If oct2.Length = 3 And CDbl(oct2) <= 9 Then ' Vérification si oct2 est soit 00#|0##|0# et adaptation du txtAddresse oct2 = oct2.Substring(2, 1) txtAddresse.Text = oct1 + "." + oct2 + "." + oct3 + "." + oct4 ElseIf oct2.Length = 3 And CDbl(oct2) >= 10 And CDbl(oct1) <= 99 Then oct2 = oct2.Substring(1, 2) txtAddresse.Text = oct1 + "." + oct2 + "." + oct3 + "." + oct4 ElseIf oct2.Length = 2 And CDbl(oct2) <= 9 Then oct2 = oct2.Substring(1, 1) txtAddresse.Text = oct1 + "." + oct2 + "." + oct3 + "." + oct4 End If If oct3.Length = 3 And CDbl(oct3) <= 9 Then ' Vérification si oct3 est soit 00#|0##|0# et adaptation du txtAddresse oct3 = oct3.Substring(2, 1) txtAddresse.Text = oct1 + "." + oct2 + "." + oct3 + "." + oct4 ElseIf oct3.Length = 3 And CDbl(oct3) >= 10 And CDbl(oct3) <= 99 Then oct3 = oct3.Substring(1, 2) txtAddresse.Text = oct1 + "." + oct2 + "." + oct3 + "." + oct4 ElseIf oct3.Length = 2 And CDbl(oct3) <= 9 Then oct3 = oct3.Substring(1, 1) txtAddresse.Text = oct1 + "." + oct2 + "." + oct3 + "." + oct4 End If If oct4.Length = 3 And CDbl(oct4) <= 9 Then ' Vérification si oct4 est soit 00#|0##|0# et adaptation du txtAddresse oct4 = oct4.Substring(2, 1) txtAddresse.Text = oct1 + "." + oct2 + "." + oct3 + "." + oct4 ElseIf oct4.Length = 3 And CDbl(oct4) >= 10 And CDbl(oct4) <= 99 Then oct4 = oct4.Substring(1, 2) txtAddresse.Text = oct1 + "." + oct2 + "." + oct3 + "." + oct4 ElseIf oct4.Length = 2 And CDbl(oct4) <= 9 Then oct4 = oct4.Substring(1, 1) txtAddresse.Text = oct1 + "." + oct2 + "." + oct3 + "." + oct4 End If
Major
Partager