Skip to main content

Windows forms and application bars

The Windows form project item lets you create a window or dialog box within a Pega Robot Studio project. You can use a Windows form as a debugging tool to test robots before integrating them with a Pega Platform™ application or a user interface (UI). The form can act as the central UI hub in which an end-user can interact and complete business tasks. 

The application bar project item lets you use a special application desktop toolbar, similar to the Windows taskbar. Most of the properties, methods, and events apply to both the Windows form and application bar. You can also set up the screen edge where the application bar is docked or how it is displayed on the desktop.

Windows form creation

The Windows form is a project item, like automation or applications, that you select from the Project tab. To design the appearance of the Windows form, add required Toolbox components to the Design form. You can customize included components using the property grid; for example, you can change the color, font, size, and location of a Button control. When added to the project, the Windows form is automatically displayed during the project launching if the StartOnProjectStart property is selected.

Toolbox components for a Windows Form

In the following image, the Windows form is used as a user interface for a client search automation. The dialog box contains a label and a text field (in which a user enters a clientID) and a button to trigger an automation.

Windows Form example

The Windows Form in automations

To use the Windows form properties, methods, and events, you must include the form in the automation Palette. The Windows form and its controls are available for the automation in the form section of the Palette. 

In the following image, the Click event of the button is the automation trigger. When the user clicks the button, the automation invokes the LogIn and ClientSearch sub-automations. 

Screenshot showing a use of Windows Form component to trigger sub-automations.

It is a best practice to use an asynchronous link when a Windows form triggers an automation and interacts with non-Windows form components. For more details about asynchronous links, see Automation links.

Application Bar

With an application bar, you can add a special desktop toolbar to your project that docks to the edge of the screen, such as the Windows taskbar. Like a Windows form, the application bar is a project item you add to the project from the Add menu of the Project Explorer. To add desired elements, and create the design of an application bar, use the components from the Toolbox. The same elements are available for both the Windows form and the application bar. 

For example, the Robotic Banking company provides a toolbar that displays basic information regarding the customer, like an account balance or agreement details. After entering the customer ID and selecting an action, a suitable sub-automation is invoked to handle the request. 

In the following image, click the + icons to learn more about using an application bar item in an automation:

After launching the project, the application bar is displayed and the project awaits for user input. For example, clicking Get Balance logs in to the banking application, acquires requested data, and displays the data in a pop-up window. 

Quick access application bar

Application Bar properties and methods

Even though an application bar uses the same set of controls as a Windows form, it has some unique properties in which you can customize its appearance and behavior:

Property name Description
AnimateHide If the value of this property is true, the application bar always stays hidden. 

DisplayStyle

  • Normal: The application bar takes a portion of the desktop and reduces the available windows screen size. 
  • AutoHide: The application bar is hidden when not in focus and does not claim a portion of the desktop.
  • Overlay: The application bar does not claim a portion of desktop
TopMost Retrieves or sets whether the location of the application bar is in TopMost AppBar on the desktop.
Edge The screen edge where the application bar is docked.

You can also toggle the application bar display on the automation level by using the ShowAppBar and HideAppBar methods. To do so, drag the main application bar control from the forms section of the Palette to the automation surface, and select the method from the Select Action window. 

Check your knowledge with the following interaction:


This Topic is available in the following Modules:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice