Command Button VB

Hi buddy of VB, in the previous tutorial we have learned about the Text Box and Label, this time we will use the toolbox Command Button, overview of the Command Button, is a toolbox that will be activated when clicked, clearly when we click the Command Button then it will happen depends on the script that have been written, for its use is so many, one of which we can use for the Login Form, Input Data, and Open Folders, but before you get there, we will learn to basic first, so that you can understand how work and use, let the following tutorial:

1. First open and run the program first (VB)
2. Then select the Standard EXE Program

Suggestion :
If you've read and practice the previous tutorial, then open again the program, and add
the CB and change the caption. If not :

3. Add 2 Command Button (CB), 2 Label (L), and 1 Text Box (TB), to Form Object Set the size so like this:

4. Change the Caption CB1 become "OK", CB2 become "Done", L1 become "Name", blank L2 and TB
Text 1
Label 2

Command1

So like this:

5. If it’s already, add the following script (click command button 2 times), so that the entire script like this:

Private Sub Command1_Click () 'Event Click
label2.caption = Text1.Text 'So the caption label1 will same with text1
End Sub

Private Sub Command2_Click ()
End
End Sub

6. Then, run the program, press F5 or Play icon
Try to enter the name / word in the text box colomn, if it is already, click the Command Button "OK", then in Label will appear a name automatically / word according the text box, and repeat again (Change the word, click "OK")

So if you were finished, click "Done" Then VB program will stop automatically, and will return to work page (form object) visual basic. Do not forget to save the project.

How easy isn’t it?,
That’s tutorial about Visual Basic Program about using Command Button

So this is enough about tutorial this time, keep visiting Blues Pedia to other interested tutorial (Daily Update)
Thank You, Good luck

Popular Posts