I had never noticed the existence of a Value property in command buttons.
I just happened to notice that today.
I googled it and came up with this:
The only relevant CommandButton's run-time property is Value, which sets or returns the state of the control (True if pressed, False otherwise). Value is also the default property for this type of control. In most cases, you don't need to query this property because if you're inside a button's Click event you can be sure that the button is being activated. The Value property is useful only for programmatically clicking a button:
This fires the button's Click event.
Command1.Value = True
on this webpage: https://www.freetutes.com/learn-vb6/...-controls.html
However, this is very strange.
Setting a commandbutton's Value property to True, appears to me to be the exact same thing as directly calling that button's Click event.
In other words, the following two pieces of code do the exact same thing:
This:
and this:
So, why would anyone want to set Command1.Value to True instead of calling its Click event function?
And Also, what does setting the value property to False do?
I tested this:
And it looks like it does nothing.
So, why would anybody want to do such thing?
And why would anybody want to inquire on (read) the value of Command1.Value?
Does anybody know what good really is a command button's Value property?
Thanks.
I just happened to notice that today.
I googled it and came up with this:
Quote:
The only relevant CommandButton's run-time property is Value, which sets or returns the state of the control (True if pressed, False otherwise). Value is also the default property for this type of control. In most cases, you don't need to query this property because if you're inside a button's Click event you can be sure that the button is being activated. The Value property is useful only for programmatically clicking a button:
This fires the button's Click event.
Command1.Value = True
However, this is very strange.
Setting a commandbutton's Value property to True, appears to me to be the exact same thing as directly calling that button's Click event.
In other words, the following two pieces of code do the exact same thing:
This:
Code:
Command1.Value = True
Code:
call Command1_Click
And Also, what does setting the value property to False do?
I tested this:
Code:
Command1.Value = False
So, why would anybody want to do such thing?
And why would anybody want to inquire on (read) the value of Command1.Value?
Does anybody know what good really is a command button's Value property?
Thanks.