USING System.Windows.Forms.* FROM ASSEMBLY.
CLASS DemoUserControlForm INHERITS Progress.Windows.Form:
/* Variable for text box and button in control container */
DEFINE PRIVATE VARIABLE rUserControl AS DemoUserControl.
CONSTRUCTOR DemoUserControlForm ( ):
InitializeComponents( ).
END CONSTRUCTOR.
/* Display and wait for this modal form to close. The caller blocks at a
call to this method */
METHOD PUBLIC VOID Wait ( ):
WAIT-FOR Application:Run (THIS-OBJECT).
END METHOD.
METHOD PRIVATE VOID InitializeComponents( ):
/* Instantiate user control */
rUserControl = NEW DemoUserControl ( ).
/* Set the text of the form title, button, and text box */
THIS-OBJECT:Text = "This is my form".
/* Set the location of the user control */
rUserControl:Location = NEW System.Drawing.Point(15, 20).
/* Add the user control to the form */
THIS-OBJECT:Controls:Add (rUserControl).
END METHOD.
END CLASS.
|