System.Gadget.Settings.ClosingEvent.cancellable Property
Gets whether the onSettingsClosing event can be cancelled.
This property is read-only.
Syntax
propVal = System.Gadget.Settings.ClosingEvent.cancellable()
Parameters
bDocked [out]
Retrieves whether the dialog box can be cancelled.Value Meaning TRUE The Settings dialog can be cancelled.
FALSE The Settings dialog cannot be cancelled..
Remarks
Examples
The following example demonstrates how to ensure the Settings dialog closes when desired.
// 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)
{
// User hit OK on the settings page.
if (event.closeAction == event.Action.commit)
{
if (txtUserEntry.value != "")
{
System.Gadget.Settings.writeString(
"settingsUserEntry", txtUserEntry.value);
// Allow the Settings dialog to close.
event.cancel = false;
}
// No user entry and 'Ok' invoked, cancel the Settings closing event.
else
{
if (event.cancellable == false)
{
event.cancel = true;
}
}
}
}
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
Send comments about this topic to Microsoft
Build date: 2/24/2010
Build type: SDK