This topic has not yet been rated - Rate this topic

msSiteModeAddButtonStyle method

[This documentation is preliminary and is subject to change.]

Defines an alternate icon image and tooltip for the specified button.

This method is not supported for Metro style apps using JavaScript.

Internet Explorer 9

Syntax

object.msSiteModeAddButtonStyle(uiButtonID, bstrIconUrl, pvarTooltip)

Standards information

There are no standards that apply here.

Parameters

uiButtonID [in]

Type: VARIANT

The ID of a button that is previously installed with msSiteModeAddThumbBarButton.

bstrIconUrl [in]

Type: BSTR

An absolute or relative URI of an icon resource.

pvarTooltip [in, optional]

Type: VARIANT

A description of the button.

Return value

Type: Variant

Returns the ID of the new button style.

Remarks

A button style consists of an additional icon and tooltip for a button position. The msSiteModeAddButtonStyle method only creates button styles; to apply them, call msSiteModeShowButtonStyle. The original icon and tooltip are automatically saved as Style 0 and do not need to be added again.

The button returns the same button ID no matter which button style is displayed. To perform the correct action, your application will need to retain the button state internally.

The icon is downloaded asynchronously. If the download fails, a blank button is used instead.

Examples

The following script adds two button styles to btnPlayPause, which was created by a prior call to the msSiteModeAddThumbBarButton method.


function addButtonStyles()
{
    stylePlay = window.external.msSiteModeAddButtonStyle(btnPlayPause,
                'http://example.com/img/play.ico', 'Play');
    stylePause = window.external.msSiteModeAddButtonStyle(btnPlayPause,
                'http://example.com/img/pause.ico', 'Pause');
} 

See also

window
external
Reference
msSiteModeAddThumbBarButton
msSiteModeShowButtonStyle

 

 

Build date: 2/13/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ