VBTrain.Net Documentation

ImageUp Property

Gets or sets the image to use in the default state of the button.

Public Property ImageUp() As Image (Graphical Button)
Public Property ImageUp() As String (Graphical Button [File], Graphical Button [Resource], Web Graphical Button)

Description

Use the ImageUp property to specify the image to be used in the button's "normal" state. This is when the button is Enabled and the mouse is not over the button.

For the GraphicalButton object, this property is the binary image which is ten stored inside the application executable.

For the GraphicalButtonFile and WebGraphicalButton objects, this is a relative path from the application/web site to the external graphic file. The GraphicalButtonFile has an ImagesFolder property that contains the common base directory for all images. Note that the directory separator is a \ for Windows applications and a / for web applications.

For the GraphicalButtonResource object, this is the name of the embedded resource. This resource must be contained in the assembly holding the button with its Build Action set to Embedded Resource.

All the Graphical Button objects have a TransparentColor property to allow that color to be transparent (chromakeyed) in any of its images. Note that all images must use the same transparent color.

The Web Graphical Button object achieves transparency (if desired) through the use of transparent .GIF or .PNG files.

Example

The following example shows how to set the ImageUp property for each type of Graphical Button as well as for the Web Graphical Button.

[Visual Basic]
'Graphical Button
With GraphicalButton1
	.ImageUp = ImageList1.Images(0)
	.ImageDown = ImageList1.Images(1)
	.ImageOver = ImageList1.Images(2)
	.ImageDisabled = ImageList1.Images(3)
End With

'Graphical Button [File]
With GraphicalButtonFile1
	.ImagesFolder = "images"
	.ImageUp = "Help Up.jpg"
	.ImageDown = "Help Down.jpg"
	.ImageOver = "Help Over.jpg"
	.ImageDisabled = "Help Disabled.jpg"
End With

' Graphical Button [Resource]
With GraphicalButtonResource1
	.ImageUp = "graphicalButton_normal.bmp"
	.ImageDown = "lmsApi.bmp"
	.ImageOver = "trainingText.bmp"
	.ImageDisabled = "webplayer.bmp"
End With

' Web Graphical Button
With WebGraphicalButton1
	.ImageUp = "images/Help Up.jpg"
	.ImageDown = "images/Help Down.jpg"
	.ImageOver = "images/Help Over.jpg"
	.ImageDisabled = "images/Help Disabled.jpg"
End With

See Also

Graphical Button Class | Web Graphical Button Class | Members