Copyright: ©1995 Stedy Software and Systems


Contents
MultiMedia Button VBX Help

Properties	Events	Methods

Description

The MMButton control is an enhanced version of the standard VB button control.  You can use it to create custom buttons that have "depressed" or "raised" bevels and font shading, and other 3-D effects.

MMButton controls have 2 "transparent" properties.

1) the ability to display odd shaped bitmaps.

2) the ability to display background image thru button face.

File Name

MMBUTTON.VBX

Class Name

MMButton

Remarks

Note: The ZOrder method and .HelpContextID property are valid only for VB versions 2.0 and later.


Properties

About	FontHighlightColor	PictureDisabled
BackColor	FontItalic	PictureDown
Bevel	FontName	PictureFocus
BevelHighlightColor	FontPlacement	PictureFromEdge
BevelShadowColor	FontShadow	PictureTransparent
BevelWidth	FontShadowColor	PictureTransparentColor
ButtonAutoSize	FontSize	PictureUp
ButtonTransparent	FontStrikethru	TabIndex
Caption	FontUnderline	TabStop
DragIcon	FontWordwrap	Tag
DragMode	ForeColor	Top
Enabled	Height	UpdateBackground
FocusRect	HelpContextID	Visible
FontAlignment	Index	WaveEnabled
FontBold	Left	WaveFileName
FontDisabledColor	MousePointer	WaveLoop
FontFromEdge	Name	WaveStyle
FontHighlight	PictureAlignment	Width


Events

Click	DragDrop	DragOver

MouseDown	MouseMove	MouseUp


Methods

Drag	Move	Refresh

SetFocus	Zorder


About Property

Description

Displays version and other related information about the ToolTip control.

Usage

Click on the ellipses button (...) next to the property text to display the About dialog box.

Remarks

Only available at design time.


Bevel Property

Description

Determines if the control has a beveled border drawn around it.

Usage

[Form!]ctlname.Bevel = setting%

Data Type

Integer

Remarks

The Bevel property settings are:

Setting	Description

-----------------------------------------------------------------------------------------

False (0)	(Default) No bevel is drawn.

True (-1)	A bevel is drawn around the control

Note: If .ButtonTransparent = FALSE then .Bevel is always TRUE.


BevelHighlightColor Property

Description

Sets or returns the "light" color, as opposed to the "shadow" color of the control.

Usage

 [Form!]ctlname.BevelHighlightColor = colorvalue&

Data Type

Long Integer

Remarks

There are two colors used when creating the 3-D effect for the control border: .BevelHighlightColor and .BevelShadowColor.  While any colors can be used, the best effect is normally achieved by setting .BevelHighlightColor to &H00FFFFFF& (White) and .BevelShadowColor to &H00808080& (Medium Gray) .

Note:	The default value is the same as the color defined

in Control Panel for the Button Highlight Color.

If .ButtonTransparent = FALSE

then .BevelHighlightColor is not used.


BevelShadowColor Property

Description

Sets or returns the " shadow " color, as opposed to the "light" color of the control.

Usage

 [Form!]ctlname.BevelShadowColor = colorvalue&

Data Type

Long Integer

Remarks

There are two colors used when creating the 3-D effect for the control border: .BevelHighlightColor and .BevelShadowColor.  While any colors can be used, the best effect is normally achieved by setting .BevelHighlightColor to &H00FFFFFF& (White) and .BevelShadowColor to &H00808080& (Medium Gray) .

Note:	The default value is the same as the color defined

in Control Panel for the Button Highlight Color.

If .ButtonTransparent = FALSE

then .BevelShadowColor is not used.


BevelWidth Property

Description

Sets or returns the size, in pixels, of the bevel or border around the edge of the control.

Usage

[Form!]ctlname.BevelWidth = setting%

Data Type

Integer

Remarks

The default is one, which means a one pixel border is drawn around the edge of the control.  The valid range is 1 to 5.  You can modify the 3-D appearance of the control by setting different .BevelWidth settings.  The .Bevel, .BevelHighlightColor, .BevelShadowColor and .BevelSize properties are used to manipulate borders of the control.

Note: If .ButtonTransparent = FALSE then .BevelWidth is always one.


ButtonAutoSize Property

Description

Determines how the image is displayed an the control.

Usage

[Form!]ctlname.ButtonAutoSize = setting%

Data Type

Integer

Remarks

The ButtonAutoSize property settings are:

Setting	Description

--------------------------------------------------------------------------------

0	Crop Image to Control

1	Size Control to Image

2	Size Image to Control

Note: .ButtonAutoSize = 2 is valid only when .PictureTransparent = FALSE.


ButtonTransparent Property

Description

Determines how the control is drawn.

Usage

[Form!]ctlname.ButtonTransparent = setting%

Data Type

Integer

Remarks

The ButtonTransparent property settings are:

Setting	Description

--------------------------------------------------------------------------------

False (0)	(Default) Control is drawn opaque

True (-1)	Control is drawn transparent


FocusRect Property

Description

Determines if a FOCUS RECTANGLE  is drawn.

Usage

[Form!]ctlname.FocusRect = setting%

Data Type

Integer

Remarks

The FocusRect property settings are:

Setting	Description

--------------------------------------------------------------------------------

False (0)	(Default) Focus Rect is not drawn

True (-1)	Focus Rect is draw


FontAlignment Property

Description

Determines where the Caption property will be displayed in the control.

Usage

[Form!]control.FontAlignment[ = type%]

Data Type

Integer (Enumerated)

Remarks

The FontAlignment property settings are:

Setting	Description

------------------------------------------------------------------------------------------------------------

0	Caption appears LEFT justified at the TOP of the control.

1	Caption appears LEFT justified in the MIDDLE of the control.

2	Caption appears LEFT justified at the BOTTOM of the control.

3	Caption appears RIGHT justified at the TOP of the control.

4	Caption appears RIGHT justified in the MIDDLE of the control.

5	Caption appears RIGHT justified at the BOTTOM of the control.

6	Caption appears CENTERED at the TOP of the control.

7	Caption appears CENTERED in the MIDDLE of the control.

8	Caption appears CENTERED at the BOTTOM of the control.


FontFromEdge Property

Description

Determines space from justified edge the caption is drawn.

Usage

[Form!]ctlname.FontFromEdge = setting%

Data Type

Integer

Remarks

FontFromEdge property will move x,y coordinates from edge of button and edge of bitmap.


FontDisabledColor Property

Description

Sets or returns the "disabled" color, as opposed to the "enabled" color of the text.

Usage

 [Form!]ctlname.FontDisabledColor = colorvalue&

Data Type

Long Integer

Remarks

The default FontDisabledColor = GetSystemColor(GrayText)


FontHighlight Property

Description

Determines if the FontHighlight is drawn.

Usage

[Form!]ctlname.FontHighlight = setting%

Data Type

Integer

Remarks

The FontHighlight property settings are:

Setting	Description

--------------------------------------------------------------------------------

False (0)	(Default) FontHighlight is not drawn

True (-1)	FontHighlight is drawn


FontHighlightColor Property

Description

Sets or returns the "light" color, as opposed to the "shadow" color of the text.

Usage

 [Form!]ctlname.FontHighlightColor = colorvalue&

Data Type

Long Integer

Remarks

There are two colors used when creating the 3-D effect for the control text: and .FontHighlightColor and .FontShadowColor.  While any colors can be used, the best effect is normally achieved by setting .FontHighlightColor to &H00FFFFFF& (White) and .FontShadowColor to &H00808080& (Medium Gray) .


FontPlacement Property

Description

Determines where caption is drawn in reference to picture placement.

Usage

[Form!]ctlname.FontPlacement = setting%

Data Type

Integer

Remarks

The FontPlacement property settings are:

Setting	Description

--------------------------------------------------------------------------------

0	No placement. Caption is placed with .FontAlignment property.

1	Caption is placed left of the picture

2	Caption is placed right of the picture

3	Caption is placed above the picture

4	Caption is placed below the picture

Note: If .FontAlignment and .PictureAlignment have identical justification, the caption most likely will not be placed on the button face.


FontShadow Property

Description

Determines if the FontShadow is drawn.

Usage

[Form!]ctlname.FontShadow = setting%

Data Type

Integer

Remarks

The FontShadow property settings are:

Setting	Description

--------------------------------------------------------------------------------

False (0)	(Default) FontShadow is not drawn

True (-1)	FontShadow is drawn


FontShadowColor Property

Description

Sets or returns the "shadow" color, as opposed to the "light " color of the text.

Usage

 [Form!]ctlname.FontShadowColor = colorvalue&

Data Type

Long Integer

Remarks

There are two colors used when creating the 3-D effect for the control text: and .FontHighlightColor and .FontShadowColor.  While any colors can be used, the best effect is normally achieved by setting .FontHighlightColor to &H00FFFFFF& (White) and .FontShadowColor to &H00808080& (Medium Gray) .


FontWordwrap Property

Description

Determines if the caption is draw on multiple lines.

Usage

[Form!]ctlname.FontWordwrap = setting%

Data Type

Integer

Remarks

The FontWordwrap property settings are:

Setting	Description

--------------------------------------------------------------------------------

False (0)	(Default) Caption is drawn on 1 (one) line

True (-1)	Caption is drawn on multiple lines


MousePointer Property

Description

Determines the mousepointer displayed on the control.

Usage

[Form!]control.MousePointer = type%

Data Type

Integer (Enumerated)

Remarks

The MousePointer property settings are:

Setting	MousePointer

-----------------------------------------------

0	 Default

1	 Arrow

2	 Cross

3	 I-Beam

4	 Size

5	 Size NE SW

6	 Size N S

7	 Size NW SE

8	 Size W E

9	 Up Arrow

10	 Hourglass

11	 Lightning

12	 Boy

13	 Clock

14	 Arm

15	 Girl

16	 Hand

17	 Question Mark

18	 Key

19	 Mouse

20	 No Drop

21	 Pencil

22	 Phone

23	 Target

24	 Wand

25	 Button Push


PictureAlignment Property

Description

Determines where the Picture property will be displayed in the control.

Usage

[Form!]control.PictureAlignment = type%

Data Type

Integer (Enumerated)

Remarks

The PictureAlignment property settings are:

Setting	Description

------------------------------------------------------------------------------------------------------------

0	Picture appears LEFT justified at the TOP of the control.

1	Picture appears LEFT justified in the MIDDLE of the control.

2	Picture appears LEFT justified at the BOTTOM of the control.

3	Picture appears RIGHT justified at the TOP of the control.

4	Picture appears RIGHT justified in the MIDDLE of the control.

5	Picture appears RIGHT justified at the BOTTOM of the control.

6	Picture appears CENTERED at the TOP of the control.

7	Picture appears CENTERED in the MIDDLE of the control.

8	Picture appears CENTERED at the BOTTOM of the control.


PictureDisabled Property

Description

This property is identical to the Picture property of the standard VB Picture Box or Form

with the exception that this property only accepts Bitmaps (not Icons or Metafiles).

Usage

[Form!]control.PictureDISABLED  = LoadPicture(“PictureFileName.BMP”)

Data Type

Integer

Remarks

This bitmap is only displayed if the button is in the 'DISABLED' state. If you do not specify a picture for this property, when the button is disabled, no picture will be displayed.


PictureDown Property

Description

This property is identical to the Picture property of the standard VB Picture Box or Form

with the exception that this property only accepts Bitmaps (not Icons or Metafiles).

Usage

[Form!]control.PictureDOWN  = LoadPicture(“PictureFileName.BMP”)

Data Type

Integer

Remarks

This bitmap is only displayed if the button is in the 'DOWN' state ('Value' property is

TRUE). If you do not specify a picture for this property, when the button is pressed, no picture will be displayed.


PictureFocus Property

Description

This property is identical to the Picture property of the standard VB Picture Box or Form

with the exception that this property only accepts Bitmaps (not Icons or Metafiles).

Usage

[Form!]control.PictureFocus  = LoadPicture(“PictureFileName.BMP”)

Data Type

Integer

Remarks

This bitmap is only displayed if the button is in the 'FOCUS' state.

If you do not specify a picture for this property, when the button gains focus, no picture will be displayed.


PictureFromEdge Property

Description

Determines space from justified edge the picture is drawn.

Usage

[Form!]ctlname.PictureFromEdge = setting%

Data Type

Integer

Remarks

PictureFromEdge property will move x,y coordinates from edge of button only.


PictureTransparent Property

Description

Determines how the control picture is drawn.

Usage

[Form!]ctlname.PictureTransparent = setting%

Data Type

Integer

Remarks

The PictureTransparent property settings are:

Setting	Description

--------------------------------------------------------------------------------

False (0)	(Default) Control picture is drawn opaque

True (-1)	Control picture is drawn transparent


PictureTransparentColor Property

Description

Sets or returns the picture transparent color.

Usage

[Form!]control.PictureTransparentColor = color&

Data Type

Long

Remarks

The background will show through all of the pixels in the image that have the transparent color.


PictureUp Property

Description

This property is identical to the Picture property of the standard VB Picture Box or Form

with the exception that this property only accepts Bitmaps (not Icons or Metafiles).

Usage

[Form!]control.PictureUP  = LoadPicture(“PictureFileName.BMP”)

Data Type

Integer

Remarks

This bitmap is only displayed if the button is in the 'UP' state ('Value' property is

FALSE). If you do not specify a picture for this property, when the button is up without focus, no picture will be displayed.


UpdateBackground Property

Description

Determines if the controls transparent background is updated on a control size or move event.

Usage

[Form!]ctlname.UpdateBackground = setting%

Data Type

Integer

Remarks

The UpdateBackground property settings are:

Setting	Description

-----------------------------------------------------------------------------------------

False (0)	New background is not captured.

True (-1)	(Default) New background is captured.

Note: If .ButtonTransparent = FALSE then .UpdateBackground is not used.


WaveEnabled Property

Description

Enables or disables wave file play on click event..

Usage

[Form!]ctlname.WaveEnabled = setting%

Data Type

Integer

Remarks

The WaveEnabled property settings are:

Setting	Description

--------------------------------------------------------------------------------

False (0)	(Default) Wave file is not played

True (-1)	Wave file is played


WaveFilename Property

Description

Specifies the file to be automatically opened and played.

Usage

[Form!]control.FileName = stringexpression$

Data Type

String

Remarks

MS Multimedia .WAV files are supported only.


WaveLoop Property

Description

Enables or disables wave file loop function.

Usage

[Form!]ctlname.WaveLoop = setting%

Data Type

Integer

Remarks

The WaveLoop property settings are:

Setting	Description

--------------------------------------------------------------------------------------------

False (0)	(Default) Wave file is not continually played

True (-1)	Wave file is continually played


WaveStyle Property

Description

Sets or returns wave file play style function.

Usage

[Form!]ctlname.WaveStyle = setting%

Data Type

Integer

Remarks

The WaveStyle property settings are:

Setting	Description

--------------------------------------------------------------------------------------------

Synchronous(0)	(Default) Wave file stops other processing

Asynchronous(-1)	Wave file does not stop other processing