|
Post by Admin on May 26, 2015 22:11:35 GMT
VB2008 IDE with A New Form
Now let’s create your first program. First of all, drag one common button into the form and change its default name to calculate,Next, click on the calculate button and enter the following code at the source code window as shown
Private Sub Button1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim num1, num2, sum As Single num1 = 100 num2 = 200 sum = num1 + num2 MsgBox (" The Sum of” & num1 & " and “& num2 & “is " & sum) End Sub
Now run your first application! And you can see the follow message box showing the sum of two numbers.
|
|