0% found this document useful (0 votes)
63 views1 page

Exercise 14

This Visual Basic code defines a form with a button and two radio buttons. When the button is clicked, it gets a string from an input box and either converts each character to its ASCII code value and displays it, or converts the displayed ASCII codes back to a string, depending on which radio button is checked.

Uploaded by

api-308657631
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views1 page

Exercise 14

This Visual Basic code defines a form with a button and two radio buttons. When the button is clicked, it gets a string from an input box and either converts each character to its ASCII code value and displays it, or converts the displayed ASCII codes back to a string, depending on which radio button is checked.

Uploaded by

api-308657631
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button1.Click
Dim message As String = InputBox("String", "test")
Dim nmessage As String = ""
For Each c As Char In message
If RadioButton1.Checked Then
nmessage = nmessage + AscW(c).ToString + " "
Label1.Text = nmessage
Else
nmessage = Label1.Text
Label1.Text = ChrW(nmessage)
End If

Next

End Sub
End Class

You might also like