PICS Button AboutBox Method
	AboutBox Method
Use the About command to find the version number and other pertinent information about PICS.


PICS Button Font Property
	Font Property
Returns a Font object.

Syntax

Visual Basic	object.Font

Visual C++	COleFont object.GetFont();

void object.SetFont(LPDISPATCH pIOleFont);

The Font property syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

Remarks

Use the Font property of an object to identify a specific Font object whose properties you want to use. For example, the following code changes the Bold property setting of a Font object identified by the Font property of a TextBox object:

Visual Basic

txtFirstName.Font.Bold = True

Visual C++

pIOleFont->SetBold(TRUE);

txtFirstName.SetFont(pIOleFont);


numeric expression

Any expression that can be evaluated as a number. Elements of the expression can include any combination of keywords, variables, constants, and operators that result in a number.


date expression

Date variables are stored as IEEE 64-bit (8-byte) floating-point numbers that represent dates ranging from 1 January 100 to 31 December 9999 and times from 0:00:00 to 23:59:59.  Any recognizable literal date values can be assigned to Date variables.  Literal dates must be enclosed within number sign characters (#), for example, #January 1, 1993# or #1 Jan 93#.

Date variables display dates according to the short date format recognized by your computer.  Times display according to the time format (either 12- or 24-hour) recognized by your computer.

When other numeric data types are converted to Date, values to the left of the decimal represent date information while values to the right of the decimal represent time.  Midnight is 0 and midday is .5.  Negative whole numbers represent dates before 30 December 1899.


Boolean expression

An expression that evaluates to either True or False.


string expression

Any expression that evaluates to a sequence of contiguous characters. Elements of the expression can include a function that returns a string, a string literal, a string constant, a string variable, a string Variant, or a function that returns a string Variant (Var Type 8).


object expression

An expression that specifies a particular object.  The expression can include any of the object’s containers.  For example, if your application has an Application object that contains a Document object that contains a Text object, the following are valid object expressions:

Application.Document.Text

Application.Text

Document.Text

Text


constant

A named item that retains a constant value throughout the execution of a program, as opposed to a variable, whose value can change during execution.  Each host application can define its own set of constants.  Additional constants may be defined by the user with the Const statement.  Constants can be used anywhere in your code in place of actual values.  A constant may be a string or a numeric literal, another constant, or any combination that includes arithmetic or logical operators except ls or exponentiation.  For example:

Const A = “My String”


object library

A file with the .OLB extension that provides information to OLE Automation controllers (like Visual Basic) about available OLE Automation objects.  You can use the Object Browser to examine the contents of an object library to get information about the objects provided.


Object Browser

A dialog box that lets you examine the contents of an object library to get information about the objects provided.


Control Panel

A set of programs that control your system configuration.  You use Control Panel utilities to adjust hardware and software options, such as desktop colors, printer selections, date and number formats, fonts, and locale settings, such as language and system of measurement.


design time

The time during which you build an application in the development environment by adding controls, setting control or form properties, and so on.  In contrast, during run time, you interact with the application as a user would.


run time

The time when code is running. During run time, you interact with the application as a user would.


multicolumn TreeView control

A multicolumn TreeView control is a TreeView control with its data arranged in a set of columns that go across the page. As opposed to the normal style, where all the data is arranged in a single column down the page.


Properties window

A window used to display or change properties of a selected form or control at design-time. Some custom controls have customized Property windows.


bitmap

An image represented by pixels and stored as a collection of bits in which each bit corresponds to one pixel. On color systems, more than one bit corresponds to each pixel. A bitmap usually has a .BMP filename extension.


icon

A graphical representation of an object or concept commonly used to represent minimized applications in Microsoft Windows. Essentially, an icon is a bitmap with a maximum size of 32 x 32 pixels. Icons have an .ICO filename extension.


metafile

A file that stores an image as graphical objects (lines, circles, polygons) rather than as pixels. There are two types of metafiles, standard and enhanced. Standard metafiles usually have a .WMF filename extension. Enhanced metafiles usually have an .EMF filename extension. Metafiles preserve an image more accurately than pixels when the image is resized.


Empty Branch Object

An empty Branch object is a Branch object that does not have an associated TreeView control item. Methods that return Branch objects may return an empty Branch object to signify the end of a list or a search failure. You can detect an empty Branch by using the IsValid member function.


PICS Button hWnd Property
	hWnd Property
Returns a handle to a Button control. Read-only at run time, not available at design time.

Syntax

Visual Basic	object.hWnd

Visual C++	OLE_HANDLE object.GetHWnd();

The object placeholder represents an object expression that evaluates to Button control.

Remarks

The Microsoft Windows operating environment identifies each form and control in an application by assigning it a handle, or hWnd. The hWnd property is used with Windows API calls. Many Windows operating environment functions require the hWnd of the active window as an argument.

Note  Because the value of this property can change while a program is running, never store the hWnd value in a variable.


PICS Button Enabled Property
	Enabled Property
Returns or sets a value that determines whether a form or control can respond to user-generated events.

Syntax

Visual Basic	object.Enabled [= boolean]

Visual C++	BOOL object.GetEnabled();

object.SetEnabled(BOOL boolean);

The Enabled property syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

boolean	A Boolean expression that specifies whether object can respond to user-generated events.

Settings

The settings for boolean are:

Setting	Description

True	(Default) Allows object to respond to events.

False	Prevents object from responding to events.

Remarks

The Enabled property allows forms and controls to be enabled or disabled at run time.  For example, you can disable objects that don't apply to the current state of the application.  You can also disable a control used purely for display purposes, such as a text box that provides read-only information.


PICS Button Caption Property
	Caption Property
Caption returns or sets the text displayed on the face of the Button control.

Syntax

Visual Basic	object.Caption [= string]

Visual C++	CString object.GetCaption();

void object.SetCaption(LPCTSTR string);

The Caption property’s syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

string	A value or constant that determines the text to be displayed on the face of a Button control.

Remarks

You can configure a shortcut key by placing an “&” symbol in front of the letter you wish to define as the shortcut key. By placing an “&” sign in front of a letter of the caption, the letter becomes underlined, and you can “click” the button by pressing the Alt-letter combination from the keyboard.


PICS Button Picture Property
	Picture Property
The Picture property sets or returns the picture displayed on the Button control.

Syntax

Visual Basic	object.Picture[= value]

Visual C++	short object.GetPicture();

void object.SetPicture(short value);

The Picture property syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

value	A value or constant that determines the picture that will be on the Button control, as described in Settings.

Settings

The Picture property settings are:

Setting	Description

0	(Default) Green Traffic Light

1	Yellow Traffic Light

2	Red Traffic Light

3	Question Mark

4	Exclamation Sign

5	Plus Sign

6	Minus Sign

7	Edit Pad

8	Note Pad

9	Circle with Diagional

10	Red X

11	Diskette

12	Waste Basket

13	Tools

14	Printer


PICS Button Click Event
	Click Event
Occurs when the user presses and then releases a mouse button over an object.  It can also occur when the value of a control is changed.

Syntax

Visual Basic	Private Sub Object_Click([index As Integer])

Visual C++	void OnClickObject();

The Click event syntax has these parts:

Part	Description

Object	An object expression that evaluates to Button object.

index	An integer that uniquely identifies a control if it's in a control array.

Remarks

For a control, this event occurs when the user:

•	Clicks a control with the left or right mouse button.  With a 3D check box, 3D command button, or 3D option button control, the Click event occurs only when the user clicks the left mouse button.

•	Presses the SPACEBAR when a 3D command button, 3D option button, or 3D check box control has the focus.

•	Presses ENTER when a form has a 3D command button control with its Default property set to True.

•	Presses ESC when a form has a Cancel buttonfor example, a 3D command button control with its Cancel property set to True.

•	Presses an access key for a control.  For example, if the caption of a 3D command button control is "&Go", pressing ALT+G triggers the event.

Typically, you attach a Click event procedure to a 3D command button control to carry out commands and command-like actions.  For the other applicable controls, use this event to trigger actions in response to a change in the control.

Note   To distinguish between the left, right, and middle mouse buttons, use the MouseDown and MouseUp events.


PICS Button KeyUp Event
	KeyUp Event
Fired each time a key is released when the Button object has input focus.

Syntax

Visual Basic	Private Sub Object_KeyUp([index As Integer,] KeyCode As Integer, Shift As Integer)

Visual C++	void OnKeyUpObject(short FAR* KeyCode, short Shift);

The KeyUp event syntax has these parts:

Part	Description

Object	An object expression that evaluates to Button object.

index	An integer that uniquely identifies a control if it's in a control array.

KeyCode	A key code, such as vbKeyF1 (the F1 key) or vbKeyHome (the HOME key).  To specify key codes, use the constants in the object library in the Object Browser.

Shift	An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys at the time of the event. The Shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2).  These bits correspond to the values 1, 2, and 4, respectively.  Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed.  For example, if both CTRL and ALT are pressed, the value of Shift is 6.

Remarks

The object with the focus receives all keystrokes. Although the KeyDown and KeyUp events can apply to most keys, they're most often used for:

•	Extended character keys such as function keys.

•	Navigation keys.

•	Combinations of keys with standard keyboard modifiers.

•	Distinguishing between the numeric keypad and regular number keys.

Use KeyDown and KeyUp event procedures if you need to respond to both the pressing and releasing of a key.

KeyDown and KeyUp aren't invoked for:

•	The ENTER key if the form has a 3D command button control with the Default property set to True.

•	The ESC key if the form has a 3D command button control with the Cancel property set to True.

•	The TAB key.

KeyDown and KeyUp interpret the uppercase and lowercase of each character by means of two arguments: KeyCode, which indicates the physical key (thus returning A and a as the same key) and Shift, which indicates the state of shift+key and therefore returns either A or a.

If you need to test for the Shift argument, you can declare constants that define the bits within the argument by using constants listed in the object library in the Object Browser.  The shift constants have the following values:

Constant	Value

vbShiftMask	1

vbCtrlMask	2

vbAltMask	4

The constants act as bit masks that you can use to test for any combination of keys.  Place the constants at the procedure level or in the Declarations section of a module and use this syntax:

Const constantname = expression

You test for a condition by first assigning each result to a temporary integer variable and then comparing Shift to a bit mask.  Use the And operator with the Shift argument to test whether the condition is greater than 0, indicating that the modifier was pressed, for example:

ShiftDown = (Shift And vbShiftMask) > 0

In a procedure, you can test for any combination of conditions, for example:

If ShiftDown And CtrlDown Then

Note   If the KeyPreview property is set to True, a form receives these events before controls on the form receive the events.  Use the KeyPreview property to create global keyboard-handling routines.


PICS Button KeyPress Event
	KeyPress Event
Fired each time a key is pressed when the Button object has input focus.

Syntax

Visual Basic	Private Sub Object_KeyPress([index As Integer,] KeyAscii As Integer)

Visual C++	void OnKeyPressObject(short FAR* KeyAscii);

The KeyPress event syntax has these parts:

Part	Description

Object	An object expression that evaluates to Button object.

index	An integer that uniquely identifies a control if it's in a control array.

KeyAscii	An integer that returns a standard numeric ANSI keycode.  The KeyAscii argument is passed by reference; changing it sends a different character to the object.  Changing KeyAscii to 0 cancels the keystroke so the object receives no character.

Remarks

The object with the focus receives the event.  A form can receive the event only if it has no visible and enabled controls or if the KeyPreview property is set to True.  A KeyPress event can involve any printable keyboard character, the CTRL key combined with a character from the standard alphabet or one of a few special characters, and the ENTER or BACKSPACE key. Changing the value of the KeyAscii argument changes the character displayed.

You can convert the KeyAscii argument into a character by using the expression:

Chr(KeyAscii)

You can then perform string operations and translate the character back to an ANSI number that the control can interpret by using the expression:

KeyAscii = Asc(char)

Use KeyDown and KeyUp event procedures to handle any keystroke not recognized by KeyPress, such as function keys, editing keys, navigation keys, and any combinations of these with keyboard modifiers.  Unlike the KeyDown and KeyUp events, KeyPress doesn't indicate the physical state of the keyboard; instead, it passes a character.

KeyPress interprets the uppercase and lowercase of each character as separate key codes and, therefore, as two separate characters.  KeyDown and KeyUp interpret the uppercase and lowercase of each character by means of two arguments: keycode, which indicates the physical key (thus returning A and a as the same key), and shift, which indicates the state of shift+key and therefore returns either A or a.

If the KeyPreview property is set to True, a form receives the event before controls on the form receive the event.  Use the KeyPreview property to create global keyboard-handling routines.

Note   The ANSI number for the keyboard combination of CTRL+@ is 0.  Because Visual Basic recognizes a KeyAscii value of 0 as a zero-length string (""), avoid using CTRL+@ in your applications.


PICS Button KeyDown Event
	KeyDown Event
Fired each time a key is pressed when the Button object has input focus.

Syntax

Visual Basic	Private Sub Object_KeyDown([index As Integer,] KeyCode As Integer, Shift As Integer)

Visual C++	void OnKeyDownObject(short FAR* KeyCode, short Shift);

The KeyDown event syntax has these parts:

Part	Description

Object	An object expression that evaluates to Button object.

index	An integer that uniquely identifies a control if it's in a control array.

KeyCode	A key code, such as vbKeyF1 (the F1 key) or vbKeyHome (the HOME key).  To specify key codes, use the constants in the object library in the Object Browser.

Shift	An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys at the time of the event. The Shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2).  These bits correspond to the values 1, 2, and 4, respectively.  Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed.  For example, if both CTRL and ALT are pressed, the value of Shift is 6.

Remarks

The object with the focus receives all keystrokes. Although the KeyDown and KeyUp events can apply to most keys, they're most often used for:

•	Extended character keys such as function keys.

•	Navigation keys.

•	Combinations of keys with standard keyboard modifiers.

•	Distinguishing between the numeric keypad and regular number keys.

Use KeyDown and KeyUp event procedures if you need to respond to both the pressing and releasing of a key.

KeyDown and KeyUp aren't invoked for:

•	The ENTER key if the form has a 3D command button control with the Default property set to True.

•	The ESC key if the form has a 3D command button control with the Cancel property set to True.

•	The TAB key.

KeyDown and KeyUp interpret the uppercase and lowercase of each character by means of two arguments: KeyCode, which indicates the physical key (thus returning A and a as the same key) and Shift, which indicates the state of shift+key and therefore returns either A or a.

If you need to test for the Shift argument, you can declare constants that define the bits within the argument by using constants listed in the object library in the Object Browser.  The shift constants have the following values:

Constant	Value

vbShiftMask	1

vbCtrlMask	2

vbAltMask	4

The constants act as bit masks that you can use to test for any combination of keys.  Place the constants at the procedure level or in the Declarations section of a module and use this syntax:

Const constantname = expression

You test for a condition by first assigning each result to a temporary integer variable and then comparing Shift to a bit mask.  Use the And operator with the Shift argument to test whether the condition is greater than 0, indicating that the modifier was pressed, for example:

ShiftDown = (Shift And vbShiftMask) > 0

In a procedure, you can test for any combination of conditions, for example:

If ShiftDown And CtrlDown Then

Note   If the KeyPreview property is set to True, a form receives these events before controls on the form receive the events.  Use the KeyPreview property to create global keyboard-handling routines.


PICS Button MouseUp Event
	MouseUp Event
Occur when the user presses (MouseDown) or releases (MouseUp) a mouse button.

Syntax

Visual Basic	Private Sub Object_MouseUp([index As Integer,] Button As Integer, Shift As Integer, x As Single, y As Single)

Visual C++	void OnMouseUpObject(short Button, short Shift, long x, long y);

The MouseUp event syntax has these parts:

Part	Description

Object	An object expression that evaluates to Button object.

index	Returns an integer that uniquely identifies a control if it's in a control array.

Button	Returns an integer that identifies the button that was pressed (MouseDown) or released (MouseUp) to cause the event.  The Button argument is a bit field with bits corresponding to the left button (bit 0), right button (bit 1), and middle button (bit 2).  These bits correspond to the values 1, 2, and 4, respectively.  Only one of the bits is set, indicating the button that caused the event.

Shift	Returns an integer that corresponds to the state of the SHIFT, CTRL, and ALT keys when the button specified in the Button argument is pressed or released.  A bit is set if the key is down.  The shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2 ).  These bits correspond to the values 1, 2, and 4, respectively.  The Shift argument indicates the state of these keys.  Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed.  For example, if both CTRL and ALT were pressed, the value of shift would be 6.

x, y	Returns a number that specifies the current location of the mouse pointer.  The x  and y values are always expressed in terms of the coordinate system set by the ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties of the object.

Remarks

Use a MouseDown or MouseUp event procedure to specify actions that will occur when a given mouse button is pressed or released.  Unlike the Click and DblClick events, MouseDown and MouseUp events enable you to distinguish between the left, right, and middle mouse buttons.  You can also write code for mouse-keyboard combinations that use the SHIFT, CTRL, and ALT keyboard modifiers.

The following applies to both Click and DblClick events:

•	If a mouse button is pressed while the pointer is over a control, that object "captures" the mouse and receives all mouse events up to and including the last MouseUp event.  This implies that the x, y mouse-pointer coordinates returned by a mouse event may not always be in the client area of the object that receives them.

•	If mouse buttons are pressed in succession, the object that captures the mouse after the first press receives all mouse events until all buttons are released.

If you need to test for the button or shift arguments, you can use constants listed in the object library in the Object Browser to define the bits within the argument:

Constant	Value	Description

vbLeftButton	1	Left button is pressed.

vbRightButton	2	Right button is pressed.

vbMiddleButton	4	Middle button is pressed.

vbShiftMask	1	SHIFT key is pressed.

vbCtrlMask	2	CTRL key is pressed.

vbAltMask	4	ALT key is pressed.

The constants then act as bit masks you can use to test for any combination of buttons without having to figure out the unique bit field value for each combination.


PICS Button Events

 Click

 KeyDown

 KeyPress

 KeyUp

 MouseDown

 MouseUp


PICS Button Methods

 AboutBox

 ResetColorScheme

 SetRedraw


PICS Button BackColor Property
	BackColor Property
BackColor returns or sets the background color of an object.

ForeColor returns or sets the foreground color used to display text and graphics in an object.

Syntax

Visual Basic	object.BackColor [= color]

object.ForeColor [= color]

Visual C++	OLE_COLOR object.GetBackColor();

OLE_COLOR object.GetForeColor();

object.SetBackColor(OLE_COLOR color);

object.SetForeColor(OLE_COLOR color);

The BackColor and ForeColor property syntax’s have these parts:

Part	Description

object	An object expression that evaluates to a Button control.

color	A value or constant that determines the background or foreground colors of an object, as described in Settings.

Settings

Visual Basic uses the Microsoft Windows operating environment red-green-blue (RGB) color scheme.  The settings for color are:

Setting	Description

Normal RGB colors	Colors specified by using the Color palette or by using the RGB or QBColor functions in code.

System default colors	Colors specified by system color constants listed in the Visual Basic (VB) object library in the Object Browser.  The Windows operating environment substitutes the user's choices as specified in the Control Panel settings.

For all forms and controls, the default settings at design time are:

BackColor set to the system default color specified by the constant vbWindowBackground.

ForeColor set to the system default color specified by the constant vbWindowText.

Remarks

The valid range for a normal RGB color is 0 to 16,777,215 (&HFFFFFF).  The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively.  The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).  If the high byte isn't 0, Visual Basic uses the system colors, as defined in the user's the Control Panel settings and by constants listed in the Visual Basic (VB) object library in the Object Browser.

To display text in the Windows operating environment, both the text color must be solid.  If the text color you've selected isn’t displayed, the selected colors may be dithered, that is, comprised of up to three different-colored pixels.  If you choose a dithered color for the text, the nearest solid color will be substituted.


PICS Button ColorCodeColor Property
	ColorCodeColor Property
ColorCodeColor returns or sets the color code color of the Button.

Syntax

Visual Basic	object.ColorCodeColor [= color]

Visual C++	OLE_COLOR object.GetColorCodeColor();

object.SetColorCodeColor(OLE_COLOR color);

The ColorCodeColor property syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

color	A value or constant that determines the color code color of a Button object, as described in Settings.

Settings

Visual Basic uses the Microsoft Windows operating environment red-green-blue (RGB) color scheme.  The settings for color are:

Setting	Description

Normal RGB colors	Colors specified by using the Color palette or by using the RGB or QBColor functions in code.

System default colors	Colors specified by system color constants listed in the Visual Basic (VB) object library in the Object Browser.  The Windows operating environment substitutes the user's choices as specified in the Control Panel settings.

Remarks

The valid range for a normal RGB color is 0 to 16,777,215 (&HFFFFFF).  The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively.  The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).  If the high byte isn't 0, Visual Basic uses the system colors, as defined in the user's the Control Panel settings and by constants listed in the Visual Basic (VB) object library in the Object Browser.

To display text in the Windows operating environment, both the text color must be solid.  If the text color you've selected isn’t displayed, the selected colors may be dithered, that is, comprised of up to three different-colored pixels.  If you choose a dithered color for the text, the nearest solid color will be substituted.


PICS Button CustomPicture Property
	CustomPicture Property
The CustomPicture property sets or returns the picture displayed on the Button control.

Syntax

Visual Basic	object.CustomPicture[= picture]

Visual C++	CPicture object.GetCustomPicture();

void object.SetCustomPicture(LPDISPATCH picture);

The CustomPicture property syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

picture	A string expression specifying a file containing a graphic, as described in Settings.

Settings

The settings for CustomPicture are:

Setting	Description

(None)	(Default) No picture.

(Bitmap, icon, metafile)	Specifies a graphic.  You can load the graphic from the Properties window at design time.  At run time, you can also set this property using the LoadPicture function on a bitmap, icon, or metafile.

Remarks

At design time, you can transfer a graphic with the Clipboard using the Copy, Cut, and Paste commands on the Edit menu.  At run time, you can use Clipboard methods such as GetData, SetData, and GetFormat with the nontext Clipboard constants vbCFBitmap, vbCFMetafile, and vbCFDIB, which are listed in the Visual Basic (VB) object library in the Object Browser.

When setting the CustomPicture property at design time, the graphic is saved and loaded with the form.  If you create an executable file, the file contains the image.

Note   At run time, the CustomPicture property can be set to any other object's Picture property, or you can assign it the graphic returned by the LoadPicture function.


PICS Button DarkHighlight Property
	DarkHighlight Property
DarkHighlight returns or sets the dark highlight color of the Button.

Syntax

Visual Basic	object.DarkHighlight[= color]

Visual C++	OLE_COLOR object.GetDarkHighlight();

object.SetDarkHighlight(OLE_COLOR color);

The DarkHighlight property syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

color	A value or constant that determines the dark highlight color of a Button object, as described in Settings.

Settings

Visual Basic uses the Microsoft Windows operating environment red-green-blue (RGB) color scheme.  The settings for color are:

Setting	Description

Normal RGB colors	Colors specified by using the Color palette or by using the RGB or QBColor functions in code.

System default colors	Colors specified by system color constants listed in the Visual Basic (VB) object library in the Object Browser.  The Windows operating environment substitutes the user's choices as specified in the Control Panel settings.

Remarks

The valid range for a normal RGB color is 0 to 16,777,215 (&HFFFFFF).  The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively.  The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).  If the high byte isn't 0, Visual Basic uses the system colors, as defined in the user's the Control Panel settings and by constants listed in the Visual Basic (VB) object library in the Object Browser.

To display text in the Windows operating environment, both the text color must be solid.  If the text color you've selected isn’t displayed, the selected colors may be dithered, that is, comprised of up to three different-colored pixels.  If you choose a dithered color for the text, the nearest solid color will be substituted.


PICS Button DarkShadow Property
	DarkShadow Property
DarkShadow returns or sets the dark shadow color of the Button.

Syntax

Visual Basic	object.DarkShadow[= color]

Visual C++	OLE_COLOR object.GetDarkShadow();

object.SetDarkShadow(OLE_COLOR color);

The DarkShadow property syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

color	A value or constant that determines the dark shadow color of a Button object, as described in Settings.

Settings

Visual Basic uses the Microsoft Windows operating environment red-green-blue (RGB) color scheme.  The settings for color are:

Setting	Description

Normal RGB colors	Colors specified by using the Color palette or by using the RGB or QBColor functions in code.

System default colors	Colors specified by system color constants listed in the Visual Basic (VB) object library in the Object Browser.  The Windows operating environment substitutes the user's choices as specified in the Control Panel settings.

Remarks

The valid range for a normal RGB color is 0 to 16,777,215 (&HFFFFFF).  The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively.  The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).  If the high byte isn't 0, Visual Basic uses the system colors, as defined in the user's the Control Panel settings and by constants listed in the Visual Basic (VB) object library in the Object Browser.

To display text in the Windows operating environment, both the text color must be solid.  If the text color you've selected isn’t displayed, the selected colors may be dithered, that is, comprised of up to three different-colored pixels.  If you choose a dithered color for the text, the nearest solid color will be substituted.


PICS Button DefaultButton Property
	DefaultButton Property
DefaultButton returns or sets the display style of the Button control.

Syntax

Visual Basic	object.DefaultButton [= boolean]

Visual C++	BOOL object.GetDefaultButton();

void object.SetDefaultButton(BOOL boolean);

The DefaultButton property’s syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

boolean	A Boolean expression that specifies whether object is drawn with a thick border to signify the default button state.

Settings

Value	Description

TRUE	The button is the default button

FALSE	(Default) The button is not the default button.


PICS Button ForeColor Property
	ForeColor Property
BackColor returns or sets the background color of an object.

ForeColor returns or sets the foreground color used to display text and graphics in an object.

Syntax

Visual Basic	object.BackColor [= color]

object.ForeColor [= color]

Visual C++	OLE_COLOR object.GetBackColor();

OLE_COLOR object.GetForeColor();

object.SetBackColor(OLE_COLOR color);

object.SetForeColor(OLE_COLOR color);

The BackColor and ForeColor property syntax’s have these parts:

Part	Description

object	An object expression that evaluates to a Button control.

color	A value or constant that determines the background or foreground colors of an object, as described in Settings.

Settings

Visual Basic uses the Microsoft Windows operating environment red-green-blue (RGB) color scheme.  The settings for color are:

Setting	Description

Normal RGB colors	Colors specified by using the Color palette or by using the RGB or QBColor functions in code.

System default colors	Colors specified by system color constants listed in the Visual Basic (VB) object library in the Object Browser.  The Windows operating environment substitutes the user's choices as specified in the Control Panel settings.

For all forms and controls, the default settings at design time are:

BackColor set to the system default color specified by the constant vbWindowBackground.

ForeColor set to the system default color specified by the constant vbWindowText.

Remarks

The valid range for a normal RGB color is 0 to 16,777,215 (&HFFFFFF).  The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively.  The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).  If the high byte isn't 0, Visual Basic uses the system colors, as defined in the user's the Control Panel settings and by constants listed in the Visual Basic (VB) object library in the Object Browser.

To display text in the Windows operating environment, both the text color must be solid.  If the text color you've selected isn’t displayed, the selected colors may be dithered, that is, comprised of up to three different-colored pixels. If you choose a dithered color for the text, the nearest solid color will be substituted.


PICS Button LightShadow Property
	LightShadow Property
LightShadow returns or sets the light shadow color of the Button.

Syntax

Visual Basic	object.LightShadow[= color]

Visual C++	OLE_COLOR object.GetLightShadow();

object.SetLightShadow(OLE_COLOR color);

The LightShadow property syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

color	A value or constant that determines the light shadow color of a Button object, as described in Settings.

Settings

Visual Basic uses the Microsoft Windows operating environment red-green-blue (RGB) color scheme.  The settings for color are:

Setting	Description

Normal RGB colors	Colors specified by using the Color palette or by using the RGB or QBColor functions in code.

System default colors	Colors specified by system color constants listed in the Visual Basic (VB) object library in the Object Browser.  The Windows operating environment substitutes the user's choices as specified in the Control Panel settings.

Remarks

The valid range for a normal RGB color is 0 to 16,777,215 (&HFFFFFF).  The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively.  The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).  If the high byte isn't 0, Visual Basic uses the system colors, as defined in the user's the Control Panel settings and by constants listed in the Visual Basic (VB) object library in the Object Browser.

To display text in the Windows operating environment, both the text color must be solid.  If the text color you've selected isn’t displayed, the selected colors may be dithered, that is, comprised of up to three different-colored pixels.  If you choose a dithered color for the text, the nearest solid color will be substituted.


PICS Button LightHighlight Property
	LightHighlight Property
LightHighlight returns or sets the light highlight color of the Button.

Syntax

Visual Basic	object.LightHighlight[= color]

Visual C++	OLE_COLOR object.GetLightHighlight();

object.SetLightHighlight(OLE_COLOR color);

The LightHighlight property syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

color	A value or constant that determines the light highlight color of a Button object, as described in Settings.

Settings

Visual Basic uses the Microsoft Windows operating environment red-green-blue (RGB) color scheme.  The settings for color are:

Setting	Description

Normal RGB colors	Colors specified by using the Color palette or by using the RGB or QBColor functions in code.

System default colors	Colors specified by system color constants listed in the Visual Basic (VB) object library in the Object Browser.  The Windows operating environment substitutes the user's choices as specified in the Control Panel settings.

Remarks

The valid range for a normal RGB color is 0 to 16,777,215 (&HFFFFFF).  The high byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively.  The red, green, and blue components are each represented by a number between 0 and 255 (&HFF).  If the high byte isn't 0, Visual Basic uses the system colors, as defined in the user's the Control Panel settings and by constants listed in the Visual Basic (VB) object library in the Object Browser.

To display text in the Windows operating environment, both the text color must be solid.  If the text color you've selected isn’t displayed, the selected colors may be dithered, that is, comprised of up to three different-colored pixels.  If you choose a dithered color for the text, the nearest solid color will be substituted.


PICS Button MouseDown Event
	MouseDown Event
Occur when the user presses (MouseDown) or releases (MouseUp) a mouse button.

Syntax

Visual Basic	Private Sub Object_MouseDown([index As Integer,] Button As Integer, Shift As Integer, x As Single, y As Single)

Visual C++	void OnMouseDownObject(short Button, short Shift, long x, long y);

The MouseDown event syntax has these parts:

Part	Description

Object	An object expression that evaluates to Button object.

index	Returns an integer that uniquely identifies a control if it's in a control array.

Button	Returns an integer that identifies the button that was pressed (MouseDown) or released (MouseUp) to cause the event.  The Button argument is a bit field with bits corresponding to the left button (bit 0), right button (bit 1), and middle button (bit 2).  These bits correspond to the values 1, 2, and 4, respectively.  Only one of the bits is set, indicating the button that caused the event.

Shift	Returns an integer that corresponds to the state of the SHIFT, CTRL, and ALT keys when the button specified in the Button argument is pressed or released.  A bit is set if the key is down.  The shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2 ).  These bits correspond to the values 1, 2, and 4, respectively.  The Shift argument indicates the state of these keys.  Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed.  For example, if both CTRL and ALT were pressed, the value of shift would be 6.

x, y	Returns a number that specifies the current location of the mouse pointer.  The x  and y values are always expressed in terms of the coordinate system set by the ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties of the object.

Remarks

Use a MouseDown or MouseUp event procedure to specify actions that will occur when a given mouse button is pressed or released.  Unlike the Click and DblClick events, MouseDown and MouseUp events enable you to distinguish between the left, right, and middle mouse buttons.  You can also write code for mouse-keyboard combinations that use the SHIFT, CTRL, and ALT keyboard modifiers.

The following applies to both Click and DblClick events:

•	If a mouse button is pressed while the pointer is over a control, that object "captures" the mouse and receives all mouse events up to and including the last MouseUp event.  This implies that the x, y mouse-pointer coordinates returned by a mouse event may not always be in the client area of the object that receives them.

•	If mouse buttons are pressed in succession, the object that captures the mouse after the first press receives all mouse events until all buttons are released.

If you need to test for the button or shift arguments, you can use constants listed in the object library in the Object Browser to define the bits within the argument:

Constant	Value	Description

vbLeftButton	1	Left button is pressed.

vbRightButton	2	Right button is pressed.

vbMiddleButton	4	Middle button is pressed.

vbShiftMask	1	SHIFT key is pressed.

vbCtrlMask	2	CTRL key is pressed.

vbAltMask	4	ALT key is pressed.

The constants then act as bit masks you can use to test for any combination of buttons without having to figure out the unique bit field value for each combination.


PICS Button Properties

 BackColor

 Caption

 ColorCodeColor

 CustomPicture

 DarkHighlight

 DarkShadow

 DefaultButton

 Enabled

 Font

 ForeColor

 hWnd

 LightHighlight

 LightShadow

 Picture

 RepeatButton

 SpecialEffect


PICS Button RepeatButton Property
	RepeatButton Property
RepeatButton returns or sets the repeat state of the Button.

Syntax

Visual Basic	object.RepeatButton[= boolean]

Visual C++	BOOL object.GetRepeatButton();

object.SetRepeatButton(BOOL boolean);

The RepeatButton property syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

boolean	A Boolean expression that specifies whether object continues to send button down events while the button is pressed.

Settings

The settings for boolean are:

Setting	Description

False	(Default) The button responds normally. When the button is pressed, a single button click event is generated.

True	The button continues to generate button click events as long as the button is pressed.

Remarks

The rate at which the button click events are generated is identical to the keyboard repeat rate.


PICS Button ResetColorScheme Method
	ResetColorScheme Method
Resets the color scheme of a Button object back to the original settings.

Syntax

Visual Basic	object.ResetColorScheme

Visual C++	void object.ResetColorScheme();

The object placeholder represents an object expression that evaluates to Button object.

Remarks

This method resets the color scheme of a Button object back to it’s original settings. The original settings match the color scheme chosen for the display as set in the control panel.


PICS Button SetRedraw Method
	SetRedraw Method
Sets the redraw state of a Button object.

Syntax

Visual Basic	object.SetRedraw[ bRedraw]

Visual C++	void object.SetRedraw(BOOL bRedraw);

The object placeholder represents an object expression that evaluates to Button object.

Remarks

To prevent redrawing of the Button object, set the bRedraw parameter to False. This will prevent the Button object from redrawing itself until the redraw state is set back to True. This method is useful to prevent unwanted redraws while a number of properties are being set.


PICS Button SpecialEffect Property
	SpecialEffect Property
SpecialEffect returns or sets the display style of the Button control.

Syntax

Visual Basic	object.SpecialEffect [= value]

Visual C++	short object.GetSpecialEffect();

void object.SetSpecialEffect(short value);

The SpecialEffect property’s syntax has these parts:

Part	Description

object	An object expression that evaluates to a Button control.

value	A value or constant that determines the display style of a Button control as described in settings.

Settings

Value	Description

0	No special effect

1	(Default) A picture is displayed on the button

2	A color code is displayed on the button.