Thursday, November 26, 2015

Visual Basic Sample Activities: Change the value of form1

How to add form1 with form2 that enters your name and change the value of the blank label of form1

1.      Add a form, Form1 to your application

2.      Change the text properties of the button to 'enter your name’.

3.      Double click the ‘Enter your name button and insert the given code below.


Me.Hide()
Form2.Show()

4.    Add a new Windows Form, Form2, two buttons, one label, and a text box to Form2.


5.    Change the text properties of the buttons to OK and Cancel respectively. Change the text properties of the label to 'Enter your name:


6.      Double click the ‘ok’ button and insert the given code.

Form1.Label1.Text = TextBox1.Text
        Form1.Show()
        Me.Hide()

7.      Double click the ‘cancel button and insert the given code.

TextBox1.Text = ""


8.      Run your program.








Visual Basic Tutorial: How to Create Hello World

How to Create Hello World in Microsoft Visual Studio

Step 1:  Add Two Buttons

2

Step 2 : Rename the buttons

3Step 3: Add new label




        Step 4: Double click the button and add the given code




Step 5: Run your program!