Try OpenEdge Now
skip to main content
GUI for .NET Programming
Creating and Using Forms and Controls : ABL support for managing .NET forms and controls
 

ABL support for managing .NET forms and controls

The general algorithm for creating and managing .NET forms is conceptually similar to creating and managing ABL windows. However, instead of creating widget objects and working with their handle attributes, methods, and events, you create .NET form and control objects and work with their object properties, methods, and events.
To block on all .NET non-modal forms in your application, you use a single occurrence of the WAIT-FOR statement (the .NET WAIT-FOR statement) that calls the static .NET input-blocking method, System.Windows.Forms.Application:Run( ). This single WAIT-FOR statement allows all non-modal .NET forms and ABL windows to be displayed and processes events for all non-modal ABL and .NET components in your application. However, to block on .NET modal forms, you use a separate .NET WAIT-FOR statement for each .NET modal form (dialog box), similar to displaying an ABL modal dialog box. This version of the .NET WAIT-FOR statement (for modal forms) calls a different input-blocking method (ShowDialog( )) on a given instance of the modal form. As noted previously (see the Limitations of support for .NET classes), you cannot call .NET input-blocking methods directly in an ABL application. Instead, you must use the .NET variation of the ABL WAIT-FOR statement to make these calls. This WAIT-FOR statement then blocks until the .NET input-blocking method returns.
Note: You cannot execute the .NET WAIT-FOR statement in a non-GUI ABL session, such as a character-mode client or AppServer agent.
.NET already provides the System.Windows.Forms.Form class to create forms. However, if you use the OpenEdge derived class (recommended), Progress.Windows.Form, to create all your .NET forms, ABL maintains the resulting instances on a single session form chain that you can access using SESSION system handle attributes. (This section describes how to access .NET forms on the session form chain.) You can then work with .NET forms and ABL windows in the same ABL session in a consistent fashion. For example, you can parent .NET forms and ABL windows to each other, creating window families that consist of both .NET forms and ABL windows. For more information on using .NET forms and windows together, see Using .NET Forms with ABL Windows
Finally, .NET allows you to create an XML resource (.resx) file associated with a given ABL class that stores resource sets (such as images) that some form controls use. To access this resource file from ABL, OpenEdge provides a .NET utility class, Progress.Util.ResourceHelper. This section describes how to use this class.
The following subsections describe:
*Initializing and blocking on .NET forms
*Blocking on non-modal forms
*Blocking on modal dialog boxes
*Accessing .NET forms using the SESSION system handle
*Accessing resource files for .NET forms
* Initializing and blocking on .NET forms
* Blocking on non-modal forms
* Blocking on modal dialog boxes
* Accessing .NET forms using the SESSION system handle
* Accessing resource files for .NET forms