Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

msSiteModeShowButtonStyle method

Changes the icon image and tooltip of a Thumbnail Toolbar button.

Internet Explorer 9

 

Syntax

object.msSiteModeShowButtonStyle(uiButtonID, uiStyleID)

Parameters

uiButtonID [in]

Type: VARIANT

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

uiStyleID [in]

Type: VARIANT

The style ID that msSiteModeAddButtonStyle returns.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The original icon and tooltip are assigned to Style 0; you can reset to the original button style by passing 0 in the uiStyleID parameter. Applying a button style will also reset the button state to active and visible.

Examples

The following script changes the Thumbnail Toolbar button style depending on whether an audio control is playing or paused. The value of stylePlay and stylePause are set by a prior call to the msSiteModeAddButtonStyle method.



function playPause() {
    var audio = document.getElementById("myAudioElement");

    if (audio.paused) {
        audio.play();
    }
    else {
        audio.pause();
    }

    try {
        if (window.external.msIsSiteMode()) {
            if (audio.paused) {
                window.external.msSiteModeShowButtonStyle(btnPlayPause, stylePlay);
            }
            else {
                window.external.msSiteModeShowButtonStyle(btnPlayPause, stylePause);
            }

        }
    }
    catch (e) {
        // Fail silently.
    }
} 

See also

window
external
Reference
msSiteModeAddButtonStyle
msSiteModeUpdateThumbBarButton

 

 

Show:
© 2017 Microsoft