I am trying to convert a text in a text box into the phonetic alphabet and I am not sure how. I have TextBox1 as my main textbox, the button to convert is Button9 and I would like the output to be in Label10.
An example of what I am trying to get is someone enters Test for example into the textbox, clicks the button, and the label shows Tango Echo Sierra Tango.
If possible it would be nice to have it automatically translate while you type it in.
I have tried using some sample code I found on the internet from How to replace letters on a textbox using vb.net but it is not doing it the way I would like when translating.
(Sample of what I tried without adding in the actual phonetic alphabet)
If TextBox1.Text.Contains("a") Then
TextBox1.Text = TextBox1.Text.Replace("a", "c")
End If
If TextBox1.Text.Contains("b") Then
TextBox1.Text = TextBox1.Text.Replace("b", "d")
End If
If TextBox1.Text.Contains("c") Then
TextBox1.Text = TextBox1.Text.Replace("c", "e")
End If
If TextBox1.Text.Contains("d") Then
TextBox1.Text = TextBox1.Text.Replace("d", "f")
End If
If TextBox1.Text.Contains("e") Then
TextBox1.Text = TextBox1.Text.Replace("e", "g")
End If
If TextBox1.Text.Contains("f") Then
TextBox1.Text = TextBox1.Text.Replace("f", "h")
End If
If TextBox1.Text.Contains("g") Then
TextBox1.Text = TextBox1.Text.Replace("g", "i")
End If
If TextBox1.Text.Contains("h") Then
TextBox1.Text = TextBox1.Text.Replace("h", "j")
End If
If TextBox1.Text.Contains("i") Then
TextBox1.Text = TextBox1.Text.Replace("i", "k")
End If
If TextBox1.Text.Contains("j") Then
TextBox1.Text = TextBox1.Text.Replace("j", "l")
End If
If TextBox1.Text.Contains("k") Then
TextBox1.Text = TextBox1.Text.Replace("k", "m")
End If
If TextBox1.Text.Contains("l") Then
TextBox1.Text = TextBox1.Text.Replace("l", "n")
End If
If TextBox1.Text.Contains("m") Then
TextBox1.Text = TextBox1.Text.Replace("m", "o")
End If
If TextBox1.Text.Contains("n") Then
TextBox1.Text = TextBox1.Text.Replace("n", "p")
End If
If TextBox1.Text.Contains("o") Then
TextBox1.Text = TextBox1.Text.Replace("o", "q")
End If
If TextBox1.Text.Contains("p") Then
TextBox1.Text = TextBox1.Text.Replace("p", "r")
End If
If TextBox1.Text.Contains("q") Then
TextBox1.Text = TextBox1.Text.Replace("q", "s")
End If
If TextBox1.Text.Contains("r") Then
TextBox1.Text = TextBox1.Text.Replace("r", "t")
End If
If TextBox1.Text.Contains("s") Then
TextBox1.Text = TextBox1.Text.Replace("s", "u")
End If
If TextBox1.Text.Contains("t") Then
TextBox1.Text = TextBox1.Text.Replace("t", "v")
End If
If TextBox1.Text.Contains("u") Then
TextBox1.Text = TextBox1.Text.Replace("u", "w")
End If
If TextBox1.Text.Contains("v") Then
TextBox1.Text = TextBox1.Text.Replace("v", "x")
End If
If TextBox1.Text.Contains("w") Then
TextBox1.Text = TextBox1.Text.Replace("w", "y")
End If
If TextBox1.Text.Contains("x") Then
TextBox1.Text = TextBox1.Text.Replace("x", "z")
End If
If TextBox1.Text.Contains("y") Then
TextBox1.Text = TextBox1.Text.Replace("y", "a")
End If
If TextBox1.Text.Contains("z") Then
TextBox1.Text = TextBox1.Text.Replace("z", "b")
End If
Each letter was translating, and it was not showing it in the right box. I am fairly new to VB and have not done this type of thing before.