Try OpenEdge Now
skip to main content
GUI for .NET Mapping Reference
Mapping Reference Entries : Common public .NET form and control methods
 

Common public .NET form and control methods

The following table lists common public .NET form and control methods:
Table 7. Common public .NET form and control methods
Method
Description
Activate( )
Brings the form to the front and publishes the Activated event.
Close( )
Closes the open form, publishing the FormClosing event followed by the FormClosed event. This method also calls the Dispose( ) method on the form.
Dispose( )
Releases all resources held by the control or control container in preparation for garbage collection. You cannot override this method, as it is defined as FINAL in ABL. Note that the object on which you call this method is not garbage collected immediately and the object reference continues to work until .NET garbage collects the object.
Note: Typically, you never have to call this method directly in ABL. If you execute the ABL DELETE OBJECT statement on the form or control object reference, this sufficiently prepares the .NET object for garbage collection wherever you might otherwise call the Dispose( ) method in .NET. However, for .NET modal forms (dialog boxes, including ABL-derived forms), you must call this method to ensure that the form object is garbage collected. For more information, see the sections on blocking for .NET dialog boxes in OpenEdge Development: GUI for .NET Programming. Before executing DELETE OBJECT, you should also call this method on any instances of Progress.Data.BindingSource that you use to bind a ProDataSet to a .NET control. For more information, see the sections on using the Dispose( ) method of a ProBindingSource, also in OpenEdge Development: GUI for .NET Programming.
Focus( )
Sets input focus on the control.
Hide( )
Conceals the control or control container from the user by setting its Visible property to FALSE.
ResumeLayout( )
Resumes layout logic for the control or control container after it was suspended using the SuspendLayout( ) method. Typically invoked on a form or other control container with a single LOGICAL argument set to FALSE in order to suppress the immediate resumption of pending layout logic until after all initialization of the control container is complete. This represents a performance improvement, especially for initializing control containers that have large numbers of child controls added.
Show( )
Initializes the control or control container for display or reveals the form to the user by setting its Visible property to TRUE. You do not always need to call this method to initially display a form, depending on how you block for input on the form.
ShowDialog( )
Displays and blocks for input on the form as a modal dialog box. You can only call this method using the WAIT-FOR statement for .NET forms (.NET WAIT-FOR statement).
Note: To block for input on the form as a non-modal window (whether for a single form or for an MDI form), you must call the static Run( ) method on the System.Windows.Forms.Application class from within a .NET WAIT-FOR statement.
SuspendLayout( )
Temporarily suspends layout of the control, form, or other control container in order to prevent Control.Layout events from firing unnecessarily while completing control initialization. After control container initialization completes, you invoke the ResumeLayout( ) method in order to allow the control initialization settings to take effect.