Represents a form on which controls can be placed.
// create our own class derived from form
class MyForm extends Form
{
function MyForm()
{
super("Hello World", 100, 100, 200, 100);
var b = new Button("Exit", 60, 20, 80, 24);
this.add(b);
b.click.connect(this, onButtonClicked);
}
function onButtonClicked()
{
Application.exit();
}
}
// create an instance of our derived MyForm class
// and show it
var f = new MyForm;
f.show();
// start the event loop; the application will exit as
// soon as the button is clicked
Application.run();
alert("Application exiting...");
Adds a form control to the form.
Centers a form relative to its parent.
Closes the form.
True if the call was successful, false otherwise.
Calling endDialog() ends a modal dialog. The value passed in the return_code parameter is returned by showDialog().
Returns the form's caption.
Returns the form's caption.
Returns the handle as an numeric value
Returns the native handle of the content area of a form. On Windows, this is the value of the content area's HWND handle.
Updates the position and size of the form's controls using the form's layout object, if it is specified. If no layout object is specified, the function does nothing.
Sets the form's caption to text.
Sets the layout object to use to position and size the form's controls.
Sets the MenuBar object to use for the form's menu bar.
Sets the StatusBar object to use for the form's status bar.
Sets the ToolBar object to use for the form's toolbar.
Shows the form if the flag is true. Hides the form if the flag is false. If flag isn't specified, the form is shown.
The integer value passed to endDialog()
Calling showDialog() displays the form as a modal dialog. Modal in this sense means that all mouse and keyboard input to all background windows will be disabled until the user is finished with the modal dialog form. The dialog's modality can be ended by calling endDialog(return_code). Standard return codes are DialogResult.OK and DialogResult.Cancel. Once endDialog() is called by the program, the showDialog() will return the value passed as a parameter to endDialog().