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
|
Public nbrChr, i As Short
Public letter, ChrLetter As String
Public ascLetter, Numspace As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
nbrChr = TextBox1.Text.Length
For i = 0 To nbrChr - 1
letter = TextBox1.Text.Substring(i, 1)
Try
ascLetter = Asc(letter)
TextBox2.Text = TextBox2.Text & ascLetter & Chr(32)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Next
TextBox1.Text = ""
TextBox1.Text = TextBox2.Text
TextBox2.Text = ""
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Tableau() As String = TextBox1.Text.Split(" ")
For i = 0 To UBound(Tableau)
ascLetter = Tableau(i)
letter = Chr(ascLetter)
Try
TextBox2.Text = TextBox2.Text & letter
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Next
TextBox1.Text = ""
TextBox1.Text = TextBox2.Text
TextBox2.Text = ""
End Sub
End Class |