Quick Find: Search for:

 Total Access Components
Control Tour

Return to Components Home
 

 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

About Box

AVI (Video)

Bitmap Effects

Border
Browse for Folder New!
CD Player
Clipboard
Clock
Common Dialogs
Date Time Picker New!
Digital Display
Enhanced Button
Gauge
Icon Menu
INI File
Marquee
Notes
Popup Menu
Progress Meter
Registry
Resize
Slider
Spin Button
Splitter
System Info
Tab Strip
Text Effects
Timer
Wave
 

 

Total Access Components Tour: Enhanced Button

Unlike 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 Control

The 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 Pictures

The 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

Name

Description

Appearance

The visual style of the button.

BackColor

The background color of the button.

ButtonStyle

Whether the button behaves as a standard or a toggle button.

Caption

The text to display on the button face.

CaptionDown

The text to display when the button is in the down state.

EffectOffset

The number of Pixels to offset copies of text for the shadowed and embossed effects.

Enabled

Whether the control can be manipulated by the user.

Font

The font of the text.

ForeColor

The color of the text.

HighlightColor

The color to use for highlighted text. This is only applicable if the TextStyle property is set to Three-D.

Picture

The bitmap, metafile, or icon to display.

PictureDown

The bitmap, metafile, or icon to display when the button is down.

PicturePosition

The position of the bitmap relative to the text.

ShadowColor

The color to use for shadowed text.

TextStyle

The effect to apply to the text.

Value Default Databound

The toggle state of the button.

Enhanced Button Methods

Name

Description

LoadPicture Loads a picture into the Picture property at run time.
LoadPictureDown Loads a picture into the PictureDown property at run time.

Enhanced Button Events

Name

Description

Click Fires when the mouse is clicked over the control.
DblClick Fires when the mouse is double clicked over the control.
KeyDown Fires when a key is depressed.
KeyPress Fires when a key is pressed.
KeyUp Fires when a key is released.
MouseDown Fires when a mouse button is depressed over a control.
MouseMove Fires when the mouse moves over the control.
MouseUp Fires when a mouse button is released over a control.

 

Questions  l   Web questions: Webmaster   l   Copyright © 2008 FMS, Inc.

Celebrating 21 Years of Software Excellence