First, I am new to programming trying to teach myself C# so please forgive me if it seems like my question or thought process seems incorrect.
What I want to do is create two text boxes on a form with one button.
That part was easy.
I want the user to input numbers only in TextBox1 which has a 5 character max length. Also easy.
But when the user clicks the button I would like to be able to grab the Text in TextBox1, manipulate it and then populate it in TextBox2.
Example: User types in 12345 then clicks the button, the event would then output 1AE4S to TextBox2.
1 =1, 2 = A, 3 = E, 4 = 4, 5 = S.
I was thinking the manipulation would probably work real well with a Dictionary by just adding a key pair value.
But my problem is how do I get that text from TextBox1 to manipulate?
I was thinking maybe an array or substring but have not been able to accomplish this.
Any advice and assistance is greatly appreciated. Thank You
Chris
Loading

Eamonn22 reputationPosted Jul 26, 2009, 10:41 AM EDT
//populate the dictionary Dictionary conversionTable = new Dictionary(); conversionTable.Add('1', '1'); conversionTable.Add('2', 'A'); conversionTable.Add('3', 'E'); conversionTable.Add('4', '4'); conversionTable.Add('5', 'S'); //put the contents of the numeric textbox into a char array char[] textBox1Chars = Textbox1.Text.ToCharArray(); //loop throught he array and swap each character from the dictionary for (int i = 0; iChris3 reputationPosted Jul 27, 2009, 8:29 PM EDT
the to array is exactly what i was looking for