Share via


System.Gadget.onSettingsClosed Event

Event fired when the gadget Settings dialog is closed.

Syntax

retVal = System.Gadget.onSettingsClosed(
  handler
)

Parameters

Remarks

Invoking the OK or Cancel button of the Settings dialog will close the dialog and fire this event.

Examples

The following example demonstrates how to use the onSettingsClosed event to read values from controls in the Settings dialog.

var userEntry = "";

System.Gadget.onSettingsClosed = SettingsClosed;

// --------------------------------------------------------------------
// Handle the Settings dialog closed event.
// event = System.Gadget.Settings.ClosingEvent argument.
// --------------------------------------------------------------------
function SettingsClosed(event)
{
    // User hit OK on the settings page.
    if (event.closeAction == event.Action.commit)
    {
        userEntry = 
            System.Gadget.Settings.readString("settingsUserEntry");
        SetContentText(userEntry);
    }
    // User hit Cancel on the settings page.
    else if (event.closeAction == event.Action.cancel)
    {
        SetContentText("Cancelled");
    }
}

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

 

 

Send comments about this topic to Microsoft

Build date: 2/24/2010

Build type: SDK