PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Scope of DelayBeforeClosing
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Limits the display duration of a window or dialog box.
If no user action is performed, when the specified amount of time is reached:
  • for a window, the code of a window button will be run.
  • for a dialog box, the dialog box is automatically closed. For the question or confirmation dialog boxes, the expected answer corresponds to the default button.
The amount of time specified for the automatic closing is ignored in the following cases:
  • when the user clicks a button.
  • if the user modifies a control.
  • if the user presses any keyboard key.
Remark: The following dialog boxes are taken into account:
By default, the dialog boxes are locking: the application is locked as long as these windows are opened.
Example
// Close the dialog box in 2 seconds
DelayBeforeClosing(200)
Error("The application will be ended")
EndProgram()
// Run the code of BTN_CloseButton in 5 seconds
DelayBeforeClosing(MyWindow, BTN_Close, 500)
// The code of BTN_Close button calls the Close function
Syntax

Timeout before closing the dialog boxes Hide the details

<Result> = DelayBeforeClosing([<Timeout>])
<Result>: Integer
Timeout that was previously defined (before the modification performed by DelayBeforeClosing).
<Timeout>: Optional integer or optional Duration
New timeout before closing the dialog boxes of application (expressed in hundredths of a second). This parameter can correspond to:
  • an integer corresponding to the number of hundredths of a second,
  • a Duration variable,
  • Versions 23 and later
    the direct indication of duration (1 s or 10 ms for example).
    New in version 23
    the direct indication of duration (1 s or 10 ms for example).
    the direct indication of duration (1 s or 10 ms for example).
If this parameter is set to 0 or if it is not specified, the timeout is endless (default case): the dialog boxes are not automatically closed.

Timeout before closing the windows Hide the details

<Result> = DelayBeforeClosing(<Window name> , <Button name> [, <Timeout>])
<Result>: Integer
Timeout that was previously defined (before the modification performed by DelayBeforeClosing).
<Window name>: Character string (with or without quotes)
Name of window for which an automatic process will be managed.
<Button name>: Character string (with or without quotes)
Name of button whose code will be run after the specified timeout. If the window must be closed, the button code must contain Close.
<Timeout>: Optional integer or optional Duration
Amount of time before running the click code of specified button (expressed in hundredths of a second).
This parameter can correspond to:
  • an integer corresponding to the number of hundredths of a second,
  • a Duration variable,
  • Versions 23 and later
    the direct indication of duration (1 s or 10 ms for example).
    New in version 23
    the direct indication of duration (1 s or 10 ms for example).
    the direct indication of duration (1 s or 10 ms for example).
If this parameter is set to 0 or if it is not specified, the timeout is endless (default case): the specified window will not be automatically closed and the timeout that was previously defined is canceled.
Remarks

Scope of DelayBeforeClosing

  • Dialog boxes: DelayBeforeClosing is taken into account for all the dialog boxes opened by the application, regardless of the code where this function is called.
    To restore a standard operating mode, use DelayBeforeClosing and specify no timeout.
  • Window: DelayBeforeClosing only applies to the specified window. The function is disabled when this window is closed: if this window is re-opened (Open), the window will not be automatically closed. DelayBeforeClosing must be re-used.
Component : wd250obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Video delaybeforeclosing_function
https://youtu.be/dg0LhDNdX-A

https://windevdesenvolvimento.blogspot.com/2019/03/dicas-2051-windev-comandos-49.html

//BTN_DelayBeforeClosing_FECHA_EM_TANTOS_sEGUNDOS
// https://doc.windev.com/en-US/?3038040&name=delaybeforeclosing_function

DelayBeforeClosing(600)
Error("O programa sera Encerrado")
EndProgram()


amarildo
21 Mar. 2019