System.Gadget.onSettingsClosing event

[The Windows Gadget Platform/Sidebar is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. ]

Event fired when the gadget Settings dialog begins the process of closing.

Syntax


iRetVal = System.Gadget.onSettingsClosing(
  handler
)

Parameters

handler

The name of the function to call when the event is fired.

Note   The function takes a parameter of type System.Gadget.Settings.ClosingEvent.
 

Remarks

Invoking the OK or Cancel button of the Settings dialog will begin the process of closing the dialog and fire this event.

This event is asynchronous.

Examples

The following example demonstrates how to save gadget settings when the onSettingsClosing event is fired.


// Delegate for the settings closing event. 
System.Gadget.onSettingsClosing = SettingsClosing;

// --------------------------------------------------------------------
// Handle the Settings dialog closing event.
// Parameters:
// event - System.Gadget.Settings.ClosingEvent argument.
// --------------------------------------------------------------------
function SettingsClosing(event)
{
    // Save the settings if the user clicked OK.
    if (event.closeAction == event.Action.commit)
    {
        System.Gadget.Settings.writeString(
            "settingsUserEntry", txtUserEntry.value);
    }
    // Allow the Settings dialog to close.
    event.cancel = false;
}

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

End of client support

Windows 7

End of server support

Windows Server 2008

IDL

Sidebar.idl

DLL

Sidebar.Exe (version 1.00 or later)

See also

System.Gadget

 

 

Community Additions

ADD
Show: