Create Form

Use the following methods to create user interface forms in Launchpad

CreateCustomForm

Creates and displays a custom form with OK and Cancel buttons.

public FormResult CreateCustomForm(string title, double width, double height, Action<Windows.CustomFormWindow> builder)

Parameters:

  • title: The title of the form window.

  • width: The width of the form window.

  • height: The height of the form window.

  • builder: An action delegate that configures the form by adding controls to it.

Returns:

  • A FormResult object containing information about whether the form was confirmed and the values entered by the user.

Behavior:

  • Creates a new CustomFormWindow with the specified title, width, and height

  • Calls the provided builder action to add controls to the form

  • Displays the form as a dialog

  • Returns a FormResult object that wraps the dialog result and form values

Example:


CreateInfoForm

Creates and displays an information form with a single Close button.

Parameters:

  • title: The title of the form window.

  • width: The width of the form window.

  • height: The height of the form window.

  • builder: An action delegate that configures the form by adding controls to it.

Returns:

  • A FormResult object containing information about whether the form was closed and the values displayed in the form.

Behavior:

  • Creates a new CustomFormWindow with the specified title, width, and height, using the CloseOnly button mode

  • Calls the provided builder action to add controls to the form

  • Displays the form as a dialog

  • Returns a FormResult object that wraps the dialog result and form values

Last updated