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

Codes!

The document contains code for a Visual Basic program that defines a form with two text boxes and a button. When the button is clicked, it takes the numbers from the text boxes, adds them together, and displays the result in a message box.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Codes!

The document contains code for a Visual Basic program that defines a form with two text boxes and a button. When the button is clicked, it takes the numbers from the text boxes, adds them together, and displays the result in a message box.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Public Class Form1

Dim num1 As Integer


Dim num2 As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

End Sub

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


System.EventArgs) Handles Button1.Click
num1 = CDbl(TextBox1.Text)
num2 = CDbl(TextBox2.Text)

Call AddThem(num1, num2)


End Sub

Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles TextBox2.TextChanged

End Sub
End Class
Module Sum
Public Sub AddThem(ByVal num1 As Integer, ByVal num2 As Integer)
Dim answer As Integer

answer = num1 + num2

MsgBox(answer)
End Sub
End Module

You might also like