Text Box and Label - Basic Program of Visual Basic

Hi buddy of Blues Pedia, on visual basic tutorial (basic) this time we will learn about:
- Adding a toolbox to the Visual Basic windows
- Change the Caption and Text from a toolbox in the Properties menu
- Change the Caption and Text from a toolbox using script

Maybe the tutorial that we will discuss this time is very trivial tutorial for VB’s Master, but it’s ok, I made this tutorial special for you guys who are learning VB, well this is the tutorial :

1. The first step is open and run Visual Basic, and then create a project with  Standard EXE type.
2. In the work page of Visual Basic, add some toolbox, but here I add a Text Box and Label, to add toolbox to the Form Object, click the toolbox icon,


then click the form object


and drag to adjust its size,


and set up like this:


Note:
Automatically every toolbox that was added will have an identity (Name), in which one with the other may not be the same, but still we can replace it with simple identity and according to our wishes in the properties colomn, for example for the Name from text box is text1 and for label is label1.

3. Then we will change the properties, in particular is a caption and text (special text box), Caption / text is naming to the toolbox that added, but different with Name, which should not be the same with other toolbox, for the caption, we can equate the properties.
Change the caption label1 become "Name / MY NAME / NAMA (Indonesia)" and text text1 be "Your Name"

Properties Label1
Properties Text1

or can also we change the caption with the script, the way:
 click Form Object 2 times until the Form Script appear, and then add the following script:

Private Sub Form_Load ()
Label1.Caption = "Name"
Text1.Text = "Your Name"
end sub


The purpose of the script: if the form was run / Active / load (Form_Load) so the caption label1 change to "Name" and text text1 changed to "Your Name", even less for end sub, there is cover script to script form_load

4. If you have tried to run the program, by pressing F5, or click the play icon in the menu bar


So this is enough for the tutorial this time, still visit the Blues Pedia or other interesting tutorials.
Thank you

Popular Posts