ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage syntax / Reserved keywords
  • Handling the current supercontrol
  • Using MyParent in a procedure
  • Summary
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
MyParent (Reserved word)
In french: MonParent
MyParent is used to handle:
  • The current supercontrol from an element of the supercontrol.
    When running the window, MyParent is replaced with the supercontrol (and not by the name of the supercontrol). Then, MyParent is used like a supercontrol.
    Advantage: MyParent is used to make the code of the controls found in the supercontrol (control, button, ...) or the code of the functions associated with the supercontrol independent of the supercontrol name.
  • The current report from one of the report controls.
  • The current window from one of the window controls.
Example
// Code of selection button
FileName = fSelect(fExtractPath(FileName, fDirectory), ...
fExtractPath(FileName, fFile + fExtension), ...
"Select a file", "All the files (*.*)" + TAB + "*.*", "")
 
// The value of the supercontrol corresponds to the selected file
MyParent..Value = FileName
Syntax
MyParent
Remarks

Handling the current supercontrol

  • MyParent is always replaced with the current supercontrol. For example, passing a parameter:
    CallProcedure(MyParent)
  • MyParent can only be used in the processes that handle the current supercontrol (for example, in the processes associated with a control found in the supercontrol, in the procedures associated with the supercontrol, ...).

Using MyParent in a procedure

MyParent can be used in a procedure associated with the current supercontrol. In this case, MyParent refers to the current supercontrol.

Summary

Code where MyParent is usedMyParent corresponds to
windowwindow
window controlwindow
window procedure, with a direct call from a window codewindow
window procedure, with a call via <Window>.<Procedure>window
window supercontrolsupercontrol
control of window supercontrolsupercontrol
procedure of window supercontrol with a direct call from a code of the supercontrolsupercontrol
procedure of window supercontrol with a call via <Supercontrol>.<Procedure>supercontrol
internal windowParent container of internal window (window, internal window, ...)
control of internal windowinternal window
procedure of internal window with a direct call from a code of the internal windowinternal window
procedure of internal window with a call via <InternalWindow>.<Procedure>internal window
supercontrol of internal windowinternal window
control of supercontrol of internal windowsupercontrol
procedure of supercontrol of internal window with a direct call from a code of the supercontrolsupercontrol
procedure of supercontrol of internal window with a call via <Supercontrol>.<Procedure>supercontrol
Remark: This table also applies to the pages and to the internal pages.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 08/31/2022

Send a report | Local help