|
Total Access Components Tour: Enhanced ButtonUnlike the standard Access button, you can use the Enhanced Button to specify both a picture and a caption for the button. You can place the picture to the left, right, above, or below the caption. In addition you can specify a separate caption and picture to display when the button is in the up position and when it is in the down position. The caption can be either in plain text or it can be one of two three-D styles. Another feature of the Enhanced Button control is that you can use it both as a standard button and as a toggle button (a button with two states to indicate True or False).
Using the Enhanced Button ControlThe Enhanced Button is a databound control that you can use in the same way as a standard Access button. You can add code to perform your desired action in the OnClick event. In most cases, you should set properties of the enhanced button at design time using the property sheet. You can, however, programmatically change these properties using VBA code if desired. One case in which you are especially likely to read or set the enhanced buttons properties in code is when the button is used in “toggle” mode. You can check the Value property of the button to determine if it is currently set to True (the button is pressed in) or False (the button is out). Setting Button PicturesThe easiest way to set the up and down picture properties of the enhanced button is at design time using the property sheet. However, it is possible to load a picture into the button programmatically at run-time. You can use the LoadPicture method of the button to assign a picture to the Picture property of the button, and use the LoadPictureDown method to assign a picture to the PictureDown property. Note that you can only assign bitmap files that are present as disk files on your machine. You cannot assign a picture from an image control or another button. Once you have changed the picture property in code, you cannot revert to the original picture that you set in design mode. Note that the pictures you assign with the LoadPicture or LoadPictureDown methods do not permanently change the button. The change is made during run-time only. Enhanced Button Properties
Enhanced Button Methods
Enhanced Button Events
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||