Form

Showing and Hiding Forms

Methods for displaying the form to the user, showing it as a modal dialog, and hiding it.

Methods for displaying the form to the user, showing it as a modal dialog, and hiding it.

Show displays the form in a non-blocking manner - the workflow continues executing while the form is visible. ShowDialog shows the form as a modal dialog - execution pauses until the form is closed by the user. Hide hides the form from view. If ShowDialog is the last call in the main method and Hide is called from a button handler, the program terminates when the form is hidden. ToGPALObject returns the GPALForm instance typed as the interface.

TIP

Use ShowDialog for forms that require user input before automation can continue. Use Show for forms that display status or run in the background while automation proceeds. Calling Hide from inside a button callback will close the ShowDialog form and allow the workflow to continue.

Examples

GPAL Fluent: High-level fluent C# API

//ShowDialog blocks the current thread until the form is hidden. In the button callback, call form.Hide() to signal completion and allow execution to resume after ShowDialog.

// Modal form - execution pauses until hidden GPAL.Form .WithTitle("Confirm Action") .WithFormControl((Button)GPAL.Button .WithText("Proceed")) .ShowDialog(); // Non-modal status form var statusForm = GPAL.Form .WithTitle("Processing...") .WithWidth(400) .WithHeight(200) .ToGPALObject(); statusForm.Show(); // ... automation runs ... statusForm.Hide();