Program to add two numbers in VB.NET

In this program we will take two numbers as input in TextBox and display the addition of numbers in a MessageBox on Button Click.

Program UI:

Screenshot (10).png

Program Code:

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim num1 As Double
Dim num2 As Double
num1 = TextBox1.Text
num2 = TextBox2.Text
MessageBox.Show(“Addition :” + (num1 + num2).ToString)

‘coversion of double value to string

End Sub
End Class

Output:

Screenshot (11).png

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s