Type: Integer (Table class), Sheet (Folder class)
Availability: Read or write at run time only
The topSheet property contains the sheet of a Folder control or Table control that is currently visible (the topmost).
For a Folder control:
The topSheet property returns the control object of the sheet that is currently on display.
Setting the topSheet property to a sheet of the folder causes that sheet to become the currently displayed sheet. This sheet must be visible.
If the value of the topSheet property is changed, focus is moved to the folder only when the control with focus is a child of the folder. If the control with focus is not a child of the folder, focus is not moved.
An alternative method is to use the showMySheet and isMySheetVisible methods.
Setting the focus to a control causes the sheet on which the control resides to be brought to the top.
For a Table control:
The topSheet property returns the index (1-relative) of the currently displayed sheet.
Setting the topSheet property to an integer index value causes the sheet with that index to become the currently displayed sheet.
The following example shows the use of the topSheet property.
buttonOK_click(btn: Button input) updating; begin if folder1.topSheet.name = 'customerEdit' then beginTransaction; myCustomer.update(textBoxName.text, textBoxAddress.text); commitTransaction; elseif folder1.topSheet.name = 'employeeEdit' then beginTransaction; myEmployee.update(textBoxName.text, textBoxTaxNumber.text); commitTransaction; endif; end;