Start ⇒ All Programs ⇒ Visual Studio 2015
WindowsApplication2
, a location such as C:\VB-workspace\
, and a solution name such as WindowsApplication2
.
Label
, whose values of the properties Text
are Number1:
, Number2:
, and Sum:
, respectively,
TextBox
, whose values of the properties Name
are Text1
, Text2
, and Text3
, respectively, and
Button
, whose values of the properties Name
and Text
are Command1
and Calculate
, respectively.
C:\VB-workspace\WindowsApplication2\WindowsApplication2\Form1.vb
|
Public Class Form1 Dim Sum As Integer Private Sub Command1_Click( sender As Object, e As EventArgs ) Handles Command1.Click Sum = Val( Text1.Text ) + Val( Text2.Text ) Text3.Text = Sum End Sub End Class |
Text1
and Text2
, whose values are entered by users, at the TextBox Text3
.
For how to write a Visual Basic program, check Introduction to the Visual Basic Programming Language.
Build ⇒ Build Solution
Debug ⇒ Start Without DebuggingOne example of execution results is as follows: