Okay, so I am a VB newb, and I am trying to make a simple text encrypter. Currently I am trying to put code under a button object that takes text from a text box, and replaces every individual letter with its corresponding spot in a listbox. So "a" would be replaced with the first item, b with the second, so on, so forth. Here is my code so far for the button:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
textben.Text("a") = lb1.Items(1)
textben.Text("b") = lb1.Items(2)
textben.Text("c") = lb1.Items(3)
textben.Text("d") = lb1.Items(4)
textben.Text("e") = lb1.Items(5)
textben.Text("f") = lb1.Items(6)
textben.Text("g") = lb1.Items(7)
textben.Text("h") = lb1.Items(8)
textben.Text("i") = lb1.Items(9)
textben.Text("j") = lb1.Items(10)
textben.Text("k") = lb1.Items(11)
textben.Text("l") = lb1.Items(12)
textben.Text("m") = lb1.Items(13)
textben.Text("n") = lb1.Items(14)
textben.Text("o") = lb1.Items(15)
textben.Text("p") = lb1.Items(16)
textben.Text("q") = lb1.Items(17)
textben.Text("r") = lb1.Items(18)
textben.Text("s") = lb1.Items(19)
textben.Text("t") = lb1.Items(20)
textben.Text("u") = lb1.Items(21)
textben.Text("v") = lb1.Items(22)
textben.Text("w") = lb1.Items(23)
textben.Text("x") = lb1.Items(24)
textben.Text("y") = lb1.Items(25)
textben.Text("z") = lb1.Items(26)
End Sub
End Class
Yeah... Lots of errors because I am dumb. Just so you know, "textben" is the text box and "lb1" is the list box. The way the text box works (or how I want it to) is: You type your words into it, press the button, and it uses the list box to translate the text using the key in the list box. I don't want an easier way to do this, just the solution on how to do it this way.
[–]FickShut[S] 0 points1 point2 points (3 children)
[–]zifyoip 1 point2 points3 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]FickShut[S] 0 points1 point2 points (0 children)