System.Gadget.Settings.ClosingEvent.cancellable property
[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. ]
Gets whether the onSettingsClosing event can be canceled.
This property is read-only.
Syntax
bcancellable = System.Gadget.Settings.ClosingEvent.cancellable
Property value
A Boolean that receives whether the dialog box can be canceled.
(TRUE)
The Settings dialog can be canceled.
(FALSE)
The Settings dialog cannot be canceled.
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 [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 |
|
DLL |
|