Search Tools Links Login

VB6 Tutorial 13: The Command Button


You are going to learn about the command button control in this lesson. The command button control is a very common one. You need it every now and then in your program. So lets have a look at some properties including a run-time property.

Properties of the Command Button

Run-time property of CommandButton

Value

The value property sets or returns the state of the control. That means , value is true if the CommandButton is pressed. This property is useful for programmatically clicking a button. Set the Name properties to cmdButton1 and cmdButton2. The default Name properties are Command1 and Command2.

Example

Private Sub cmdButton1_Click()
    Print "Hello"
End Sub

Private Sub cmdButton2_Click()
    cmdButton1.Value = True
End Sub

When you click on Button2, Button1 is clicked programmatically , then it prints "Hello".

About this post

Posted: 2018-04-01
By: vb6boy
Viewed: 738 times

Categories

Visual Basic 6

VB6 Tutorial

Attachments

CommandButton.zip
Posted: 4/1/2018 10:47:23 AM
Size: 1,145 bytes


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.

ADODB.Connection error '800a0e79'

Operation is not allowed when the object is open.

/assets/inc/inc_footer.asp, line 37