System.Gadget.onSettingsClosing Event
Event fired when the gadget Settings dialog begins the process of closing.
Syntax
retVal = 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 |
Minimum supported server | Windows Server 2008 |
IDL | Sidebar.idl |
DLL | Sidebar.Exe version 1.00 or later |
See Also
Send comments about this topic to Microsoft
Build date: 2/24/2010
Build type: SDK