How to Create a Temperature Converter in VB.Net

0
58

This Tutorial is all about How to Create a Temperature Converter in VB.Net. In this tutorial about Temperature Converter in VB.Net, you will be able to convert Celsius to Fahrenheit and Fahrenheit to Celsius. So lets get Started:

  • First is open the Visual Basic, Select File on the menu, then click New and create a new project.

  • Then a New Project Dialog will appear. You can rename your project, depending on what you like to name it. After that click OK

  • After that, design your form like this just like what I’ve shown you below
    Add a Masked Textbox, 2 RadioButton, Label and a Button.

  • The Label in the bottom of the Design will be the Results. So please Erase the text of Label and leave it blank.
  • Go to Convert Button and Add this Following Codes.
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. If RadioButton1.Checked = True Then
  3. Label1.Text = MaskedTextBox1.Text & " Fahrenheit = " & (MaskedTextBox1.Text - 32) / 1.8 & " Celsius"
  4. ElseIf RadioButton2.Checked = True Then
  5. Label1.Text = MaskedTextBox1.Text & " Celsius = " & (MaskedTextBox1.Text * 1.8) + 32 & " Fahrenheit"
  6. End If
  7. End Sub
  • Finally Click F5 to run the program.

Ouptut:

 

If you have any comments or suggestions about on How to Create a Temperature Converter in VB.Net, please feel free to contact our webpage.

Download How to Create a Temperature Converter in VB.Net Here

Other Articles Readers might read:

 

 

 

 

Facebook Comments
(Visited 56 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here