Overview of Form Control Types

This topic describes the types of controls that you can use on a form. For general information about form controls, see Form Controls and Create Form Controls.

The data source for a control can be set when the control is created (if you drag a field or field group into the form design), or it can be set by using the properties described in the following table. If you drag a field into the form design, the data type of the field determines the kind of control that is created.

NoteNote

If you set the data source for a control by using the DataMethod property and the method you want to use is on a table used as a data source in the form, you must also set the DataSource property. You do not need to set the DataSource property if the method is on the form or on the Data Source node within the form.


Control Name

Description

Data Source

Comments

ActiveX

Any ActiveX control available on the computer.

The control type is selected when you create the control, and is displayed in the ClassName property.

To learn about ActiveX controls on forms, see Adding ActiveX Controls to Forms.

Animate

A control used to display an .avi file.

The .avi file is set by using the AnimateFile property.

The .avi file must not have a sound track.

TipTip
If you set the AutoPlay property to Yes and the Loops property to 0, the system plays the designated .avi file indefinitely.

Button

A rectangular button.

The behavior for the button is set by overriding the clicked method for the control.

If the button displays an image, the image is set by using the NormalImage/DisabledImage or the NormalResource/DisabledResource property.

Buttons are usually grouped under a ButtonGroup control.

If you want to create a button for a commonly used command (for example, Open or Save) or to open a system menu, use a CommandButton control.

The ButtonDisplay property determines whether the button displays an image.

If the DefaultButton property is set to Yes, the button is selected when the user presses Enter on the form.

ButtonGroup

A facility used to group buttons that belong together under a heading.

No data source.

N/A

CheckBox

A square box that is selected or cleared to turn an option on or off. More than one check box can be selected.

The data source is set by using the DataSource and DataField properties, or by using the DataMethod property.

This type of control is automatically created if you drag a field into the form design that has an enumerated data type with two values.

ComboBox

A text box with an attached list box. You can select an item from the list, or type in a new value.

The data source is set by using the DataSource and DataField properties, or by using the DataMethod property.

This type of control is automatically created if you drag a field into the form design that has an enumerated data type with more than two values.

CommandButton

A button to activate a command. For example, to close the form, to save all, or to activate one of the system menus.

No data source.

The function of the control is set by using the Command property. You can choose from a many options. For example, New, Open, Save, Undo, Select All, Next Tab Page.

DateEdit

A control used to display and edit dates.

The data source is set by using the DataSource and DataField properties, or by using the ExtendedDataType property, or the DataMethod property.

The following properties are inherited from the data type on which the control is based:

  • Alignment

  • DateFormat

  • DateSeparator

  • DateYear

  • DateMonth

  • DateDay

Grid

A table that displays records from a database table.

The data source is set by using the DataSource property.

All data entry forms should open on an Overview tab that displays records in a grid.

Group

A facility used to group several fields under a heading.

The data source is set by using the DataSource property.

This type of control is automatically created if you drag a field group into the form design.

GuidEdit

A control used to display and edit GUIDs.

The data source is set by using the DataSource and DataField properties, or by using the ExtendedDataType property or the DataMethod property.

N/A

HTML

A control used to display and edit HTML-based text.

The content (if any) for this control is set by using the FormHTMLControl.setText method.

For an example of this control, see the tutorial_Form_Controls form.

Int64Edit and IntEdit

The controls used to display and edit integers.

The data source is set by using the DataSource and DataField properties, or by using the ExtendedDataType property, or the DataMethod property.

IntEdit controls are for 32-bit integers.

Int64Edit controls are for 64-bit integers.

Users can enter an expression in the control. The result is evaluated when they leave the control.

The following properties are inherited from the data type on which the control is based:

  • Alignment

  • SignDisplayRotateSign

  • ShowZero

  • DisplaceNegative

Listbox

A box presents the user with a list of choices.

The data source is set by using the DataSource and DataField properties, or by using the ExtendedDataType property, the EnumType property, or the DataMethod property.

N/A

ListView

A list box that displays a collection of items where each item consists of an icon and a label.

The content and behavior of a ListView control must be defined by using code. For an example, see the tutorial_Form_ListControl form.

The icons in a ListView are supplied by using an image list. For more information, see Using Image Lists for Controls.

ListView controls can display content in the following views:

  • Large Icon

  • Small Icon

  • List

  • Details

These views are similar to those in Microsoft Windows Explorer.

MenuButton

A button that opens a submenu.

N/A

A MenuButton control can contain Button, CommandButton, and MenuItemButton controls, and separators.

MenuItemButton

A button to activate a menu item.

The MenuItemType and MenuItemName properties identify the menu item to be activated.

N/A

Progress

A control used to show the percentage of completion of a lengthy operation. It consists of a bar that “fills” from left to right.

The code to control the progress bar should be written on the clicked method for the Button control.

Note   It is best practice to use the Progress Indicators framework instead of a Progress control on a form. For more information, see Create Progress Indicators.

RadioButton

A round button used to select one of a group of mutually exclusive options.

The data source is set by using the DataSource and DataField properties, or by using the ExtendedDataType property, the EnumType property, or the DataMethod property.

N/A

RealEdit

A control used to display and edit real numbers.

The data source is set by using the DataSource and DataField properties, or by using the ExtendedDataType property or the DataMethod property.

Users can enter an expression in the control. The result is evaluated when they leave the control.

The following properties are inherited from the data type on which the control is based:

  • Alignment

  • SignDisplay

  • RotateSign

  • ShowZero

  • DisplaceNegative

  • ThousandSeparator

  • DecimalSeparator

  • NoOfDecimals

  • AutoInsSeparator

StaticText

A control used to display text.

The text to display in the form is specified by using the Text property.

To enable users to edit the text, use a StringEdit control.

StringEdit

A control used to display and edit text strings.

The data source is set by using the DataSource and DataField properties, or by using the ExtendedDataType property or the DataMethod property.

A StringEdit control can span multiple lines. This is defined by the MultiLine property.

The following properties are inherited from the data type on which the control is based:

  • Alignment

  • Uppercase

Tab

A group control that contains TabPage controls.

No data source.

The Tab property controls which tab pages should be displayed when the user opens the form. Best practice is to leave this property set to Auto to display the first tabbed page.

Table

A spreadsheet-like table with rows and columns.

The content of a Table control must be defined by using code. For an example, see the tutorial_Form_Table form.

The Table control is not associated with the database. This control looks similar to a Grid control, but it can display values of different types within in a single column.

TabPage

An additional page on the form.

No data source.

A TabPage control is typically used when there is too much information to display in a single dialog.

You can create a TabPage control only within a Tab control.

The Caption property determines the text that is displayed on the tab.

TimeEdit

A control used to display and edit a time.

The data source is set by using the DataSource and DataField properties, or by using the ExtendedDataType or the DataMethod property.

The following properties are inherited from the data type on which the control is based:

  • Alignment

  • TimeFormat

  • TimeHours

  • TimeMinute

  • TimeSeconds

  • TimeSeparator

Tree

A special list box control that displays a set of objects as an indented outline based on their logical hierarchical relationship.

The content and behavior of a Tree control must be defined by using code. For an example, see the tutorial_Form_TreeControl form.

The icons in a Tree control are supplied by using an image list. For more information, see Using Image Lists for Controls.

Window

A window that displays a bitmap.

The bitmap can be specified by using the ImageName property, the ImageResource property, or the DataSource and DataField properties, or the DataMethod property.

For more information on Window controls, see Add an Image to a Form, and see the tutorial_Form_Windowingrid form.

Community Additions

ADD
Show: