Form Building

Building a Form vs Automating One

GPAL.Form builds a GUI that belongs to your workflow -- a window you design, with controls you place. GPAL.Application automates someone else's GUI -- a window that already exists, with controls you locate. They share a vocabulary (buttons, inputs, checkboxes) but solve opposite problems.

Two Different Questions

GPAL.Application answers 'how do I interact with a window I don't control?'. It finds an existing application's controls by AutomationID, name, or class name and drives them (see Automation Targets). GPAL.Form answers a different question: 'how do I show the user something, or collect input from them, as part of my own workflow?' GPAL.Form builds a brand new window from scratch. You choose every control, its position, and its behavior. Then displays it with Show or ShowDialog.

// Automating an existing application's window (Automation Targets)

application

.LeftClick(GPAL.Selector.WithAutomationID("SaveButton"));

// Building your own window (Form Building)

GPAL.Form

.WithTitle("Confirm Action")

.WithFormControl((Button)GPAL.Button

.WithText("Proceed"))

.ShowDialog();

Why a Workflow Needs Its Own Forms

A workflow built with GPAL.Form is useful well beyond simple dialogs: a 'Processing...' status window shown non-modally while a browser automation runs in the background, a confirmation prompt before a destructive database action, or a small data-entry form that feeds rows into FillInFrom for a longer automation. The form is part of the tool you're building, not a target you're reverse-engineering.

// A non-modal status window shown while automation runs

var statusForm = GPAL.Form

.WithTitle("Processing...")

.WithWidth(400)

.WithHeight(200)

.ToGPALObject();

statusForm.Show();

// ... browser or application automation runs here ...

statusForm.Hide();

Same Vocabulary, Different Direction

Both subsystems use WithSelector-style addressing and a fluent settings-then-action pattern, and both ultimately deal with buttons, text boxes, checkboxes, and grids. The difference is direction: GPAL.Application selectors describe where to find a control that already exists; GPAL.Form controls (GPAL.Button, GPAL.Input, GPAL.Checkbox, and the rest, covered next) describe a control to create. Don't expect to 'find' a GPAL.Form control with a selector, and don't expect to 'place' an Application control. Each subsystem only does one of those things.