Bonsoir ,Je suis novice en la matière et
suite a mon dictionary de code je voudrai ajouter par exemple un message dans un textBox ou l'affichage d'une pictureBox.
dans le codage ci dessous le mot exemple s'affiche dans la texBox3 et y reste
ce qui est normal mais je voudrai changer en fonction de la saisi TexBox1 (add) .Merci pour votre aide .
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 { String^ b; Dictionary< String^, String^ > ^ dict; dict = gcnew Dictionary< String^, String^>(); dict->Add(L"C004",L"message 1"),(b = "exemple 1"); dict->Add(L"C005",L"message 2"),(b = "exemple 2"); dict->Add(L"C006",L"message 3"),(b = "exemple 2"); dict->Add(L"C007",L"message 3"); String^ a = textBox1->Text; String^ Result; if(dict->ContainsKey(a)) { textBox2->Text = dict[a]; textBox3->Text = b; } else { textBox2->Text = L"Code Inconnu"; } }
Partager