Bonjour à tous !

Je cherche un peu d'aide s'il vous plait ! (je débute en Vb.net, Wpf etc..., je suis en alternance)

Voici mon code et en fait je voudrai mettre des espaces entre chaque caractère du mot de passe voici mon Xaml :

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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
 
<?xml version="1.0" encoding="utf-8"?>
<Window
x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Password"
Height="300"
Width="860">
<Grid>
 
<Grid Name="UserAccessGrid" ShowGridLines="False">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="128" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="297" />
<ColumnDefinition Width="13" />
<ColumnDefinition Width="297" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="128" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="39" />
<RowDefinition Height="81" />
<RowDefinition Height="97" />
<RowDefinition Height="*" />
<RowDefinition Height="90" />
<RowDefinition Height="170" />
</Grid.RowDefinitions>
<TextBlock Name="ComMenuTextA" Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="3" Text="Preferences access code ?" FontSize="26" Foreground="#FF8AD4E8" FontFamily="Gotham" FontWeight="Light" HorizontalAlignment="Center" Background="Transparent"/>
<Grid Name="AccessCodeGrid" ShowGridLines="False" Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="3" Background="White">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="94" />
<ColumnDefinition Width="83" />
<ColumnDefinition Width="29" />
<ColumnDefinition Width="83" />
<ColumnDefinition Width="29" />
<ColumnDefinition Width="83" />
<ColumnDefinition Width="29" />
<ColumnDefinition Width="83" />
<ColumnDefinition Width="94" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="14" />
<RowDefinition Height="58" />
<RowDefinition Height="5" />
<RowDefinition Height="20" />
</Grid.RowDefinitions>
<PasswordBox
Name="passwordBox"
PasswordChanged="passwordBox_PasswordChanged"
FontFamily="Gotham"
FontSize="95"
FontWeight="SemiBold"
Grid.Column="1" 
Grid.ColumnSpan="7"
Grid.Row="0"
Grid.RowSpan="3"
HorizontalAlignment="Center"
VerticalAlignment="Stretch"
Margin="0,0,0,5"
Width="410" 
Height="90"/>
<TextBlock Name="PassWordA" Text="" FontFamily="Gotham" FontSize="95" FontWeight="SemiBold" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="1" Background="Transparent" Width="50"/>
<TextBlock Name="PassWordB" Text="" FontFamily="Gotham" FontSize="95" FontWeight="SemiBold" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="3" Background="Transparent" Width="50"/>
<TextBlock Name="PassWordC" Text="" FontFamily="Gotham" FontSize="95" FontWeight="SemiBold" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="5" Background="Transparent" Width="50"/>
<TextBlock Name="PassWordD" Text="" FontFamily="Gotham" FontSize="95" FontWeight="SemiBold" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="7" Background="Transparent" Width="50"/>
 
 
</Grid>
</Grid>
</Grid>
</Window>


Et voici mon .VB :

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
 
 
'
' Created by SharpDevelop.
' User: Ism
' Date: 05/01/2018
' Time: 13:01
' 
' To change this template use Tools | Options | Coding | Edit Standard Headers.
'
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
 
''' <summary>
''' Interaction logic for MainWindow.xaml
''' </summary>
Public Partial Class MainWindow
Inherits Window
 
Public Sub New()
InitializeComponent()
End Sub
 
Private Sub passwordBox_PasswordChanged(ByVal sender As Object, ByVal e As RoutedEventArgs)
'PassWordA = passwordBox
'PassWordB = passwordBox 
'PassWordC = passwordBox 
'PassWordD = passwordBox 
 
passwordBox.MaxLength = "4"
passwordBox.PasswordChar="*"
 
If passwordBox.Password = "4321" Then
MessageBox.Show("ok")
Else 
 
End If
 
End Sub
 
End Class






Voici ce que je veux


Nom : Les espaces.PNG
Affichages : 810
Taille : 22,2 Ko




et ça c'est ce que j'ai avec mon code...


Nom : Moi ce que j'ai.PNG
Affichages : 669
Taille : 31,5 Ko

J'ai créer ceci : PasswordA(-B-C-D) et je voudrai en fait que chaque caractère de mon mot de passe s'affiche espacé donc prennent la place de passwordA B C et D ??

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
<TextBlock Name="PassWordA" Text="" FontFamily="Gotham" FontSize="95" FontWeight="SemiBold" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="1" Background="Transparent" Width="50"/>
<TextBlock Name="PassWordB" Text="" FontFamily="Gotham" FontSize="95" FontWeight="SemiBold" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="3" Background="Transparent" Width="50"/>
<TextBlock Name="PassWordC" Text="" FontFamily="Gotham" FontSize="95" FontWeight="SemiBold" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="5" Background="Transparent" Width="50"/>
<TextBlock Name="PassWordD" Text="" FontFamily="Gotham" FontSize="95" FontWeight="SemiBold" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="7" Background="Transparent" Width="50"/>

je vois pas comment faire avec mon code ? Je cherche depuis 2-3 jours mais je n'y arrive pas...

Pouvez vous m'aider svp ??