Page 54 - Open Soource Technologies 304.indd
P. 54
Event Driven Programming
If the Command Button was big enough, the caption would appear under the picture instead of
over it.
Down Picture
Sets the picture to be displayed while the button is pressed down i.e., when the user holds the
mouse button or the space key on it. The Style property must be set to 1 - Graphical.
Enabled
When this property is set to True, the user is not able to interact with the Command Button in
any way e.g. it cannot be clicked on or have focus. The caption will appear greyed out.
Font
In design time, this brings up the Font dialog box to allow you to choose the font name, style,
size and whether the Strikeout and Underline attributes are set. When writing code to set the
font of the Command Button, Font acts as an object, which has its own properties:
• Bold
• Charset
• Italic
• Name
• Size
• Strikethrough
• Underline
• Weight
Command1.Font.Bold = True
Command1.Font.Italic = True
Command1.Font.Underline = True Alternatively, you can use the FontBold (Boolean),
FontItalic (Boolean), FontName (String), FontSize (Single), FontStrikethru (Boolean)
and FontUnderline (Boolean) properties, which are only available at runtime.
Height
Sets the height of the Command Button.
Index
Leave blank unless the Command Button is to be part of a control array.
Left
Sets the X coordinate of the Command Button.
MaskColor
This property only comes into effect when the following conditions are met - the Style property
is set to 1 - Graphical, the UseMaskColor property is set to True and a background picture is being
48 LOVELY PROFESSIONAL UNIVERSITY