Partager via


BUTTON Element

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The BUTTON element provides a way to create a button within a skin. The attributes below can be used to customize the behavior of a button, or a predefined button can be used for convenience.

The BUTTON element supports the following attributes.

Attribute Description
cursor Specifies or retrieves the cursor that appears when the mouse pointer hovers over the BUTTON.
disabledImage Specifies or retrieves the image that displays when the BUTTON is disabled.
down Specifies or retrieves a value indicating whether the BUTTON is in the up or down position.
downImage Specifies or retrieves the image representing the down state of the BUTTON.
downToolTip Specifies or retrieves the ToolTip text that appears when the mouse is over the BUTTON and the BUTTON is in the down or depressed state.
hoverDownImage Specifies or retrieves the image displayed when the BUTTON is in the down state and the user hovers over it with the mouse pointer.
hoverImage Specifies or retrieves the image displayed when the BUTTON is in the up state and the user hovers over it with the mouse pointer.
image Specifies or retrieves the default image of the BUTTON.
sticky Specifies or retrieves a value indicating whether the BUTTON is a toggle, that is, whether it is a two-state or single-state button.
tiled Specifies or retrieves a value indicating whether the BUTTON image will be tiled.
transparencyColor Specifies or retrieves the color that will be transparent in the BUTTON image.
upToolTip Specifies or retrieves the ToolTip text that appears when the mouse is over the BUTTON and the BUTTON is in the up state.

 

The BUTTON element supports the ambient attributes and can implement the ambient event handlers. For more information, see Ambient Attributes and Ambient Event Handlers.

Predefined buttons are normal BUTTON elements with various common attribute settings specified by default. The following predefined buttons are available.

Predefined BUTTON Description
CLOSEBUTTON A BUTTON used to close the Player.
FFWDBUTTON A BUTTON with a built in call to player.controls.fastForward when clicked.
IMAGEBUTTON A BUTTON used to display an image.
MINIMIZEBUTTON A BUTTON used to minimize the Player.
MUTEBUTTON A BUTTON used to mute and un-mute the audio.
NEXTBUTTON A BUTTON with a built in call to player.controls.next when clicked.
PAUSEBUTTON A BUTTON with a built in call to player.controls.pause when clicked.
PLAYBUTTON A BUTTON with a built in call to player.controls.play when clicked.
PREVBUTTON A BUTTON with a built in call to player.controls.previous when clicked.
REPEATBUTTON A BUTTON that toggles the Repeat option.
RETURNBUTTON A BUTTON that returns Windows Media Player to the media center.
REWBUTTON A BUTTON with a built in call to player.controls.fastReverse when clicked.
SHUFFLEBUTTON A BUTTON that toggles the Shuffle option.
STOPBUTTON A BUTTON with a built in call to player.controls.stop when clicked.

 

Skin Programming Reference