0% found this document useful (0 votes)
51 views

Exercise 2

This code defines a class called Form1 with a private subroutine called Button1_Click that handles clicks on a button. When the button is clicked, it takes the text from a text box, subtracts 32, multiplies by 5/9, and assigns the result to the text of a label, converting Fahrenheit to Celsius.

Uploaded by

api-307933689
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

Exercise 2

This code defines a class called Form1 with a private subroutine called Button1_Click that handles clicks on a button. When the button is clicked, it takes the text from a text box, subtracts 32, multiplies by 5/9, and assigns the result to the text of a label, converting Fahrenheit to Celsius.

Uploaded by

api-307933689
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Exercise 2

Public Class Form1


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Label1.Text = 5 / 9 * (TextBox1.Text - 32)
End Sub
End Class

You might also like