Share via


System.Gadget.Settings.ClosingEvent.Action Property

Contains a value from the enumeration of closing actions for the Settings dialog.

This property is read-only.

Syntax

propVal = System.Gadget.Settings.ClosingEvent.Action()

  

Parameters

  • action [out]
    Retrieves the closing action.

    Value Meaning
    commit

    Ok button invoked.

    cancel

    Cancel button invoked.

     

Remarks

Used in the Settings dialog box callbacks (onSettingsClosing and onSettingsClosed).

Examples

The following example demonstrates how to store a Settings value when the Settings dialog closes.

// --------------------------------------------------------------------
// Handle the Settings dialog closing event.
// Parameters:
// event - System.Gadget.Settings.ClosingEvent argument.
// --------------------------------------------------------------------
function SettingsClosing(event)
{
    // User hit OK on the settings page.
    if (event.closeAction == event.Action.commit)
    {
        System.Gadget.Settings.writeString(
        "settingsUserEntry", "OK");
    }
    // User hit Cancel on the settings page.
    else if (event.closeAction == event.Action.cancel)
    {
        System.Gadget.Settings.writeString(
                "settingsUserEntry", "CANCEL");
    }
    // Allow the Settings dialog to close.
    event.cancel = false;
}

Requirements

Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
IDL Sidebar.idl
DLL Sidebar.Exe version 1.00 or later

See Also

System.Gadget.Settings.ClosingEvent

Reference

onSettingsClosing

onSettingsClosed

cancel

cancellable

closeAction

 

 

Send comments about this topic to Microsoft

Build date: 2/24/2010

Build type: SDK