ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Control functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Runs the closing WLanguage event of an office control and displays its confirmation dialog if necessary.
Example
// Click the VALIDATE button
IF NOT ControlExecuteClosing(PSHEET_Spreadsheet) THEN
RETURN
END
Close()
Syntax
<Result> = ControlExecuteClosing(<Office control>)
<Result>: Boolean
  • If the closing WLanguage event of the control returns a value (True or False), <Result> corresponds to this value.
  • If the closing WLanguage event of the control returns no value:
    • if the Modified property of the control is set to True, a confirmation dialog is displayed: <Result> is set to False if the user asks not to close the document, True otherwise.
    • if the Modified property of the control is set to False, the function returns True.
<Office control>: Control name
Name of office control to use. This control can correspond to:
  • a Spreadsheet control,
  • a Word Processing control,
  • an Image Editor control,
  • a PDF Reader control.
Remarks
  • This function is automatically called by the ribbon of office controls (Spreadsheet, Word Processing, Image Editor or PDF Reader controls) on the following user actions:
    • New.
    • Open.
    • Drag and Drop a document to the control.
  • This function performs the following operations:
    • Running the event "Before closing the document".
    • If this event returns a value (True or False), the function stops and returns this value.
    • If this event does not return a value:
      • if Modified on the control is set to True, the function displays a confirmation dialog to the user and it returns False if the user asks not to close the document.
      • if the Modified property of the control is set to False, the function returns True.
  • This function can be called for example when closing a window or before a new content is assigned to the control.
  • The following code allows you to display the confirmation dialog only:
    bCloseOK = AAFExecute(PSHEET_Spreadsheet, aafClosingDialog)
  • To run only the closing WLanguage event of the document, use the following code:
    ExecuteProcess(PSHEET_Spreadsheet, trtBeforeClosingDocument)
Component: wd290obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/07/2022

Send a report | Local help