Table of Content
	Motion Works MediaShop [image]  : Picture Button
Picture Buttonis a Visual Basic Custom Control (Pictbtn.vbx) that provides the utility to apply creative graphics for computer screen buttons.  To gain a more in-depth knowledge of this control, simply click on the following topic.

To learn how to use help, press F1.

Contacting Motion Works

Picture Button Control


Contacting Motion Works

If you have any questions, comments, or suggestions,  Motion Works would like to hear from you.  You can contact Motion Works at:

Motion Works USA,

524 Second Street, San Francisco,

CA  94107,

U. S. A.

Tel: 1-800-800-8476, Direct (415)-541-9333,

Fax: (415)-541-0555


Picture Buttons
	Interactive Picture Buttons
Properties	Events

Description	The picture button control provides users with easy access in using bitmaps as buttons. Interaction with the buttons are made possible through the properties and /or Events.  This is what the control looks like as an icon in the Toolbox:
File Name	PICTBTN.VBX
Object Type	Pictbtn
Remarks	The picture button control makes it possible to represent buttons with a graphical bitmap instead of using the standard text. To create the picture button control, simply double-click on the above button on the tool palette.  A blank button with borders will then appear.
__________________________________________________________________________________

Distribution Note   When you create and distribute applications that use the Picture Button Control, you should install the file PICTBTN.VBX in the customer's Microsoft Windows \SYSTEM subdirectory . The setup kit included with the Professional Edition of Visual Basic provides tools to help you write setup programs that install your applications correctly.

__________________________________________________________________________________


Picture Button, PROPERTIES

PROPERTIES

There are a number of properties used to communicate between the picture button and Visual Basic. The following is a list of available properties for this control. Asterisk(*) denotes properties that apply to this control only or that require special consideration when used with it.

Properties

*About	Height	*UpPicture
*AutoSize	Index	Visible
BackColor	Left	Width
*BorderStyle	MousePointer
*ButtonState	Name
*ButtonType	*Offset-X
*CenterBitmap	*Offset-Y
*DownPicture	*PushButtonDrawDelay
DragIcon	TabIndex
DragMode	TabStop
*Enabled	Tag
*EmbedPicture	Top


Picture Button, EVENTS

EVENTS

The following is a list of available events for this control.

Events

Click	KeyPress	MouseUp
DblClick	KeyUp	MouseMove
KeyDown	MouseDown


Picture Button Property, ABOUT
About Property

Description	Displays an About box for the control which contains the name of the control, version number and the author.
Visual Basic	Not Applicable.
Remarks	This property can only be used during development time and is activated by double clicking on the About property field which displays "Click here..."
Data Type	Not Applicable


Picture Button Property, AUTOSIZE
AutoSize Property

Description	Size the control to match the size of the Bitmap.
Visual Basic	[form.]Pictbtn.AutoSize[ = setting%]
Remarks	This property only works in design mode.
Setting	Description
TRUE	(Default) Activates Autosizing.
FALSE	Disable Autosizing
Data Type	Integer (Boolean)


Picture Button Property, BORDERSTYLE
BorderStyle Property

Description	Determines if there is a push button style border frame around the Picture Button.
Visual Basic	[form.]Pictbtn.BorderStyle[ = setting%]
Remarks	The following are the BorderStyle property settings for the picture button control.
Setting	Description
0	(Default) Indicates the border is ON.
1	Indicates the border is OFF.
Data Type	Integer


.$

ButtonState Property

Description	Determines the initial state of the picture button control. Setting this property will set the initial state of the button up or down
Visual Basic	[form.]Pictbtn.ButtonState[ = setting%]
Remarks	The following are the ButtonState property settings for the picture button control.
Setting	Description
0	(Default) Indicates that the initial state of the button is set up.
1	Indicates the initial state of the button is set  down.
Data Type	Integer
Visual Basic	The following example shows how to set up the bitmap for the
Example	down button state in a visual basic program:
Sub Form_Load ()
	PictBtn1.ButtonState = 1	' 1 represents the down state
		' 0 represents  the up state
End Sub


Picture Button Property, BUTTONTYPE
ButtonType Property

Description	Indicates the type of the picture button used.
Visual Basic	[form.]Pictbtn.ButtonType[ = setting%]
Remarks	The following are the two available ButtonType property settings for the picture button.
Setting	Description
0	(Default) Push Button
1	Indicates Toggle Button
Data Type	Integer


Picture Button Property, CENTERBITMAP
CenterBitmap Property

Description	Determines whether a bitmap is centered within a picture button.
Visual Basic	[form.]Pictbtn.CenterBitmap[ = setting%]
Remarks	The following are the two available CenterBitmap property settings for the picture button.
Setting	Description
False	(Default) No centralization of bitmap.
True	Enable the ability to centralize a bitmap on a button
Data Type	Integer


Picture Button Property, DOWN PICTURE
DownPicture Property

Description	Loads the desired bitmap file for the picture button's down state.  The display in this property field will display the path name to the bitmap file if the "EmbedPicture" property is set to FALSE and will display the word (Embedded) if the "EmbedPicture" property is set to TRUE.
Visual Basic	[form.]Pictbtn.DownPicture[ = filename$]
Remarks	Setting this property will replace the current bitmap displayed for the state of the picture button.
Data Type	String


Picture Button Property, ENABLED
Enabled Property

Description	Activate or deactivate the picture button.
Visual Basic	[form.]Pictbtn.Enabled[ = setting]
Remarks	Setting this property to FALSE will gray out the already existed bitmap meaning that the button is disabled.  The default setting of this property is TRUE meaning that the button is enabled.
Data Type	String


Picture Button Property, EMBEDPICTURE
EmbedPicture Property

Description	Determines whether to embed the picture for your button into the form or load the bitmap everytime from an external file by retrieving it from a specified path.
Visual Basic	[form.]Pictbtn.EmbedPicture[ = setting]
Remarks	Toggling this property will dump any bitmaps previously loaded in the UpPicture and DownPicture properties.  Therefore, be sure to set this property first before specifying the bitmaps.
Setting	Description
TRUE	Enable the Embedded button.
FALSE	(Default) Disable the Embedded button.
Data Type	Integer (Boolean)

Also see

UpPicture

DownPicture


Picture Button Property, Offset-X
Offset-X Property

Description	Determines the horizontal offset (in TWIPS) of the left of the bitmap to the left side of the button. NOTE: The left side of the button is offset 0.
Visual Basic	[form.]Pictbtn.Offset-X[ = setting]
Remarks	Setting this property will indicate an X-Axis offset to the right of the origin.
	See the following diagram.
Data Type	Integer


Picture Button Property, Offset-Y
Offset-Y Property

Description	Determines the vertical offset (in TWIPS) of the top of the bitmap  to the top side of the button. NOTE: The top side of the button is offset 0.
Visual Basic	[form.]Pictbtn.Offset-Y[ = setting]
Remarks	Setting this property will indicate an Y-Axis offset underneath the origin.
	Also see Offset-X.
Data Type	Integer


Picture Button Property, PUSHBUTTONDRAWDELAY
PushButtonDrawDelay Property

Description	Determines the time-delay (in milliseconds) that allows a button to refresh its bitmap when it is pressed.  This is required expecially when  a large bitmap is used in the picture button.
Visual Basic	[form.]Pictbtn.PushButtonDrawDelay[ = setting]
Remarks	Setting this property to a high value would generate a long time delay before the upstate of the button is repainted.  Default value for this property is 0.
Data Type	Integer


Picture Button Property, UP PICTURE
UpPicture Property

Description	Loads the desired bitmap file for the picture button's up state. The display in this property field will display the path name to the bitmap file if the "EmbedPicture" property is set to FALSE and will display the word (Embedded) if the "EmbedPicture" property is set to TRUE.
Visual Basic	[form.]Pictbtn.UpPicture[ = filename$]
Remarks	Setting this property will replace the current bitmap displayed for the state of the picture button.
Data Type	String