Condividi tramite


Overview of Form Control Types

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

This topic describes the types of controls that you can use on a form. For general information about form controls, see Form Controls Overview and How to: Add a Control to a Form.

Some form controls require that you specify a data source. The data source supplies the values that appear in the control. You can add controls to a form by dragging a field or field group onto the Design node of the form. The data source property of the control is populated with name of the table for that field or field group. For more information, see How to: Add a Control to a Form.

Note

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

If a control does not automatically identify a data source, use the information in the following table to populate the data source property of that control.

Control name

Description

Data source

Comments

ActionPane

A control that adds the action pane bar to a form.

Use the DataSource property to associate a data source with the action pane. The default data source is the primary data source of the form.

Use an action pane to show the action pane tab controls for the form.

ActionPaneTab

A control that displays and labels a collection of related actions.

Not applicable.

Use an action pane tab to group actions by task or Microsoft Dynamics AX role. To display an action pane tab in the action pane, add one or more button group controls.

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.

Enables you add ActiveX controls to a form. To learn about ActiveX controls on forms, see How to: Add ActiveX Controls to Forms.

Caution

The ActiveX control is considered deprecated. To add a Windows Form or Windows Presentation Foundation control to a form, use the ManagedHost control.

Animate

A control that is used to display an .avi file.

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

Use the control to show animated images. The .avi file must not have a sound track.

Note

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 or the NormalResource property.

Use a button to start an action. Buttons are usually grouped under a ButtonGroup control.

If you want to create a button for a frequently 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.

For a form where the Style property of the Design node is set to Dialog, you can set the DefaultButton property of the button to Yes to select the button when you press Enter on the form.

ButtonGroup

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

Use the DataSource property to associate a data source with the button group. The default data source is the primary data source of the form.

Use button groups to organize and label related action. All the buttons that appear in a ButtonGroup use the same size.

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.

Use this kind of control for fields that have an enumerated data type with two values.

ComboBox

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

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

Use this kind of control for fields that have an enumerated data type with more than two values.

To prevent a user from adding values to the control, set the ComboType property to List.

CommandButton

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

Not applicable.

Use this kind of control when you want a button to start a function. The function of the control is set by using the Command property. You can select from many options. For example, New, Open, Save, Undo, Select All, and Next Tab Page.

DateEdit

A control that is 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.

Use this kind of control to show and edit date values. The following properties are inherited from the data type on which the control is based:

  • Alignment

  • DateFormat

  • DateSeparator

  • DateYear

  • DateMonth

  • DateDay

DropDialogButton

A button that opens a small form you use to update specified field values.

The data source is set by using the DataSource property.

Use the MenuItemName property to specify a menu item. The menu item Object property specifies the form that appears when you click the button.

Grid

A table that displays records from a database table.

The data source is set by using the DataSource property.

Open all data entry forms to 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.

Use this control to group and label related fields. This type of control is automatically created if you drag a field group onto the form design.

GuidEdit

A control that is 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.

Not applicable.

HTML

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

The content for this control is set by using the FormHTMLControl.setText method.

Not applicable.

IntEdit and Int64Edit

The controls that were 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.

Use this kind of control to show integer values on a form. The IntEdit controls are for 32-bit integers and the 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

  • DisplaceNegative

  • ShowZero

  • SignDisplayRotateSign

Listbox

A box that 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.

Not applicable.

ListView

A list 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.

Use this kind of control to show a list together with icons. The icons in a ListView are supplied by using an image list. For more information, see How to: Create an Image List for Controls.

A ListView control displays the icons that are contained in an image list. To organize the icons, specify a of value for the ViewType property:

  • Icon

  • Small icons

  • List

  • Report

The ViewType property values correspond to the Large Icons, Small Icons, List, and Details settings from the Views list of the Microsoft Windows Explorer toolbar.

ManagedHost

A control that hosts a Windows Form or Windows Presentation Foundation control on a form.

The type of control is specifed by the TypeName and AssemblyName properties of the control.

Use this control to add Windows Form and Windows Presentation Foundation controls to a form. For information about how to add a .NET control to a form, see How to: Add a .NET Control to a Form.

MenuButton

A button that opens a submenu.

Not applicable.

Use this kind of control to provide access to a list of buttons. A MenuButton control can contain Button, CommandButton, and MenuItemButton controls, and Separators.

MenuItemButton

A button to open a menu item.

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

Not applicable.

Progress

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

To use a progress control, you have to supply code that fills the progress bar.

For example, you add a progress control for an operation that starts when a button is clicked. To update the progress control, you have to add code to the clicked method of the button control that fills the progress bar as the operation runs.

Note

Use a progress indicator from the progress indicator framework instead of a progress control. For information about how to use the progress indicator framework, see How to: 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.

Not applicable.

RealEdit

A control that is 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.

Use this kind of control to show and edit numeric values. 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

  • AutoInsSeparator

  • DecimalSeparator

  • DisplaceNegative

  • NoOfDecimals

  • RotateSign

  • ShowZero

  • SignDisplay

  • ThousandSeparator

ReferenceGroup

The control you use to add a surrogate foreign key field to a form.

Use the DataSource property to specify the table in the form data source that contains the field you want bound to the control. Use the DataReference property to specify the field in the DataSource table that contains the surrogate foreign key value.

Use this control to enable the lookup of related records. The control contains a control that displays the fields that replace the surrogate foreign key value. The ReplacementFieldGroup specifies the field group that replaces the foreign key value. The control includes a lookup you can use to select or update the value that appears in the control.

SegmentedEntry

The control you use to view or enter account number and associated dimensions as segments in a single field on a form.

Use the DataSource property to specify the table in the form data source that contains the field you want bound to the control. Use the DataReference property to specify the field in the DataSource table that contains the surrogate foreign key value.

Use this kind of control to show and edit account numbrs. The ReplacementFieldGroup specifies the field group that replaces the foreign key value. The control includes a lookup you can use to select or update the value that appears in the control. Use the ContextFlyout property to enable context flyout that helps identify each segment of the account number.

Separator

A control that is used to add space between buttons in a button group or a menu button.

Not applicable.

Use the separator control to organize buttons into related groups or highlight a button that represents a key task or action.

StaticText

A control that is used to display text.

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

Use a StringEdit control when you want to enable users to change text values.

StringEdit

A control that is 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.

Use a StringEdit control to show text that 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.

Not applicable.

Use this kind of control to organize a group of tab pages. 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.

Use this kind of control to show a list of data in a grid. The Table control is not associated with the database. This control resembles a Grid control, but it can display values for different types in a single column.

TabPage

An additional page on the form.

Not applicable.

Use this kind of control to organize and label a collection of fields on a form. A TabPage control is typically used when there is too much information to display in a single dialog box.

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

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

TimeEdit

A control that is used to display and change a time.

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

Use this kind of control to show and edit time values. 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 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.

Use this kind of control to show hierarchical data. The icons in a Tree control are supplied by using an image list. For more information, see How to: Create an Image List for Controls.

UtcDateTimeEdit

Automatically converts Coordinated Universal Times (UTC) into local date/time for display. Also converts local date/time into UTC for storage.

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

Use this kind of control to show and edit date and time values. For more information, see Time Zone and DateTime Display 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.

Use this kind of control to add images to a form. For more information about Window controls, see How to: Add an Image to a Form.

See also

How to: Add a Control to a Form

Form Control Properties

Methods on Form Controls

Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.