Although properties, methods, and events do different things, it's important to
realize that they're often interrelated. For example, if you move a control with
the Move method (most likely in response to an event), one or more of the control's
position properties (Top, Height, Left, and Width) will change as a result. Because
the control's size has changed, the Resize event occurs.
This interdependence means that you can sometimes accomplish the same task multiple ways in your code by manipulating object properties or methods. Consider the following code, which shows two ways to move a CommandButton:
As another example, you can make a form appear and disappear from the screen by using its Visible property or its Show and Hide methods, as follows:
This interdependence means that you can sometimes accomplish the same task multiple ways in your code by manipulating object properties or methods. Consider the following code, which shows two ways to move a CommandButton:
`Move the commandbutton by setting the properties
cmdMove.Left = 100 cmdMove.Top = 100
`Move the commandbutton by using the Move method
cmdMove.Move 100, 100
As another example, you can make a form appear and disappear from the screen by using its Visible property or its Show and Hide methods, as follows:
` Make the form visible by setting the property
frmMyForm.Visible=True ` Hide the form by setting the property frmMyForm.Visible=False ` Make the form visible by using the Show method frmMyForm.Show ` Hide the form by using the Hide method frmMyForm.Hide