In this section:

How to:


The Winform command controls the forms that appear on the screen. Forms are used to edit and display data. They act as a user interface, whereas a procedure controls the application logic and use of data.

Top of page

Syntax: How to Use the Winform Command

The Winform command performs three tasks:

The syntax of the Winform command for displaying and controlling forms is

Winform command formname [;]

where command is one of the following:


Makes the specified form active. It displays the form and transfers control to it, enabling an application user to manipulate the controls (of the form), such as buttons and fields. In a Windows-deployed application, if other forms are currently displayed on the screen, the specified form is displayed on top.


Can be used for clarity. It is functionally identical to Show.


In Windows-deployed applications, this displays the specified form without making it active. Because the form is inactive, control passes to the following command, not to the form. You can use this to change the initial properties of a form, and its controls, dynamically at run time before the form is displayed.

In web-deployed applications, you can use this to change the initial properties of a form, and its controls, dynamically at run time. SHOW_INACTIVE does not display the form.

In web-deployed applications, this option does not apply.


Resets a form and its controls to their original properties. All selectable controls, such as list boxes, check boxes, and radio buttons, return to their default selections.


Repopulates the data values of the form as if control had returned to the form from an event handler, but without making the form active.

In web-deployed applications, this option does not apply.


Closes all forms. The form environment remains active.


Closes the chain of forms from the currently active form back up to the specified form. If you do not specify a form, the command closes only the currently active form.

The close operation does the following:

  • Passes control directly to the beginning of the chain, to the point just following the Winform Show command that called the specified form.
  • Removes closed forms from the screen.

Displays the specified form and then immediately terminates the application. This enables you to end an application while displaying a final form that remains on the screen. In an application deployed in a web browser, this avoids returning the end user to the launch form. Any client-level logic (such as hypertext links, JavaScript and VBScript functions, and Java applets) will remain active, but all native Maintain logic such as event handlers will not respond because the application has terminated. SHOW_AND_EXIT is not applicable to Windows-deployed applications.

The syntax of the Winform command for changing a form control property is:

Winform Set formname[.controlname].property TO value [;]

The syntax of the Winform command for querying a form control property is

Winform Get formname[.controlname].property INTO variable [;]



Is the name of the form.


Is the name of the form control whose property you wish to set or get. Omit the control name if you are changing a property for an entire form, otherwise you must specify it.


Is any valid property.


Is a value that is valid for the specified property.


Is any scalar variable (a user-defined field or a stack cell) to which you will assign the value of the specified property of the specified form or control.


Terminates the command. Although the semicolon is optional, including it to allow for flexible syntax and better processing is recommended. For more information about the semicolon, see Terminating Command Syntax.

For information about form and control properties, see Form and Control Properties Reference in the Developing WebFOCUS Maintain Applications manual. For information about using the WINFORM SET and GET commands, see Dynamically Changing Form Control Properties.

Top of page

Reference: Commands Related to Winform

Top of page

Displaying Default Values in a Form

If a form displays a variable that has not been assigned a value, the form will display the default value. The default value of the variable is determined by its data type and whether it was defined with the MISSING attribute:

Data Type

Default value without the MISSING attribute

Default value with the MISSING attribute







Date and time



A null value is displayed as a period (.) by default. You can specify a different character using the SET NODATA command.

Dynamically Changing Form Control Properties

You can change many properties of forms and controls at run time using the Winform Set command, and can determine the current state of those properties using the Winform Get command. You can set other properties using functions.

If you want to change the properties of a form at run time before the form is displayed, you can first issue the Winform Show_Inactive command, then issue commands to set form and control properties, and finally issue a Winform Show command. In Windows-deployed applications, Winform Show will make the form active. In web-deployed applications, it will display the form. If you wish to change the properties of a form in response to user activity in the form, you can trigger a function containing Winform Set commands and function calls from those user events. You cannot dynamically set the properties of a form before it has been opened with either a Winform Show or Winform Show_Inactive.

For example, you could develop a data entry function that determines whether a user has entered data into a field. If the user has not, you could use the Winform Set command to change the color of the field and give it focus, effectively drawing attention to it and making it the target of any keyboard activity.

For information about form and control properties, see the Developing WebFOCUS Maintain Applications manual.