Export (0) Print
Expand All

Methods on Form Controls

Each control on a form has a standard group of methods that you can override to customize the behavior of the control. The methods available depend on the type of control. Use the following steps to access these methods.

  1. Expand the node for the control.

  2. Right-click the Methods node.

  3. Click Override Method.

The methods available in the Override Method menu are a subset of those available on the system class for that control type. For example, methods for manipulating CheckBox controls are in the FormCheckBoxControl class. The methods for manipulating Grid controls are in the FormGridControl class. For a list of these classes, see Form Control Classes.

NoteNote

Code written on forms cannot be re-used or inherited. If possible, write your code on the underlying table or in a class.


The following table describes the methods that you can override for form controls. For more information about each method, see its Help topic. For example, the copy method for a ComboBox control is described in the FormComboBoxControl.copy method topic. The copy method for a Tree control is described in the FormTreeControl.copy method topic.

Method name

Executed when

Comments

activateItem

The user activates an item in a ListView control.

The super() call manages the activation of the item (for example, a program) represented by the icon.

activeCellChanged

The user makes a change to the current cell in a Table control.

N/A

allItemsDeleted

The user has deleted all items in a ListView control.

N/A

beginDrag

The user begins to drag a form control or item within a control.

This method is not called if the DragDrop property is disabled for the control.

beginLabelEdit

The user begins editing (renaming) the label for a node in a Tree control.

This method returns a Boolean value. You can use it to prevent a user from editing the label.

clicked

The user clicks a control.

N/A

colLabel

Not activated by the system.

The super() call returns the text specified for the column heading in a Table control.

columnClicked

When the user clicks a column header in a ListView control.

Pass in the column index (zero-based) to determine which column the control will be sorted on.

command

TBD

TBD

context

The user right-clicks the control.

The super() call displays the shortcut menu.

copy

The user copies content from a control.

N/A

cut

The user cuts content from a control.

N/A

data

Not activated by the system.

The super() call returns the contents of a cell in a table control.

NoteNote
Do not override the data method. An override might prevent users from accessing their data.

doubleClick

The user has double-clicked an item in a ListView or ListBox control.

N/A

dragLeave

TBD

TBD

dragOver

The user is dragging a control or an item within a control over another item.

This method is called only if the DragDrop property is enabled for the control and a beginDrag event has already been started.

dragOverEx

TBD

TBD

dragText

The user is dragging an item in a Tree control.

N/A

drop

The user drops a control or an item within a control into a new position.

This method is called only if the DragDrop property is enabled for the control and a beginDrag event has already been started.

dropEx

TBD

N/A

dropFile

The user drags a file from outside Microsoft Dynamics AX and drops it onto a Window control.

The dropFile method is called with the file name as the parameter.

editControl

The user moves their mouse pointer over a Tree control.

N/A

endDrag

The user stops dragging a form control or an item within a control.

This method is called only if the DragDrop property is enabled for the control, and a beginDrag event has already been started.

endLabelEdit

The user has finished editing (renaming) the label for a node.

N/A

enter

The user moves focus to a control.

This method is useful for controls where a user can select a particular item, such as a grid cell.

For more information, see the gotFocus method in this topic.

expanded

A Tree control has been expanded.

N/A

expanding

A Tree control is expanding.

This method returns a Boolean value. You can use the value to prevent a user from expanding the tree.

filter

The user clicks the Filter by Selection command in the shortcut menu on a form control.

N/A

gotFocus

The user brings the control into focus.

N/A

helpField

The user clicks the control.

The super() call displays the text in the HelpText property for the control. If not specified on the control, this text is inherited from the field or from the extended data type.

You can display another Help text by overriding the method.

hotTrackItem

TBD

TBD

inputSearch

The user enters input in a control that has the SearchMode property set.

You can set up a control to search for the value a user types into the control by setting the SearchMode property. When search begins, the inputSearch method is called with the search string as a parameter.

itemChanged

An item in a ListView control is changed.

N/A

itemChanging

An item in a ListView control is changing.

N/A

itemCopy

The user has copied an item in a ListView or Tree control.

N/A

itemDeleted

The user has deleted an item in a ListView or Tree control.

N/A

itemInserted

The user has inserted an item in a ListView control.

N/A

itemMoved

The user has moved an item in a ListView or Tree control.

N/A

jumpRef

The user activates the Go to main table command from the shortcut menu on the control or by pressing CTRL+ALT+F4.

The super() call opens the main table that contains data for the field.

keyDown

The user presses the Down arrow in a ListView or Tree control.

N/A

labelMouseDblClick

The user double-clicks on the label for the control.

N/A

labelMousedown

The user clicks the mouse pointer when it is over the label for the control.

N/A

labelMouseup

The user releases the mouse pointer over the label for the control.

N/A

leave

The user moves focus out of a control.

This method is useful for controls where a user can select a particular item, such as a grid cell.

For more information, see the lostFocus method in this topic.

lookup

The user uses the Lookup facility.

For more information, see How to: Create a Lookup Form.

lostFocus

The user brings the control out of focus.

N/A

menuFunction

Not called by the system.

This method returns the menu item that is called by the control.

modified

The user exits an edit field (for example, a StringEdit or IntEdit control) after changing it.

–or–

The user changes a value in a CheckBox, ComboBox, ListBox, or RadioButton control.

The super() call manages the table update (by a sequence of calls to validate on the data source, validateField on the table, and modified on the data source).

mouseDblClick

The user double-clicks a control.

N/A

mouseDown

The user releases the left mouse pointer button after clicking a control.

N/A

mouseEnter

The user moves the mouse pointer into the control area.

N/A

mouseLeave

The user moves the mouse pointer out of the control area.

N/A

mouseMove

The user moves the mouse pointer over the control.

N/A

mouseUp

The user presses the left mouse pointer button.

N/A

onHScroll

TBD

TBD

onVScroll

TBD

TBD

paint

A Window control is redrawn.

The super() call draws the background and displays the .bmp file.

paste

The user pastes content into a control.

N/A

performFormLookup

The user clicks a Lookup button on a control.

N/A

processBase

TBD

TBD

processForm

TBD

TBD

processLink

TBD

TBD

processPicture

TBD

TBD

processTitle

TBD

TBD

rowLabel

Not activated by the system.

The super() call returns the text specified as the row heading in a Table control.

selectionChanged

The user has moved the selection to another item in a ListView or Tree control.

N/A

selectionChange

The user alters the selection in a ComboBox, ListBox, or RadioButton control.

N/A

selectionChanging

The user is moving the selection to another item in a ListView or Tree control.

This method returns a Boolean value. You can use the value to prevent a user from being able to change the selection. For example, to disable the selection of a particular item.

setScrollInfo

TBD

TBD

showContextMenu

The shortcut menu for a control is opened.

N/A

size

TBD

TBD

sort

TBD

TBD

tabChange

A change of tabbed pages has taken place.

Do not override the tabChange or tabChanged methods on Tab controls. Instead, override the pageActivated and allowPageDeactivate methods on Tabpage controls.

If you override tabChange or tabChanged, the user setup level for the tab cannot be higher than Restricted. The user cannot fully customize the layout and content.

The parameters received for tabChange and tabChanged are based on tabbed page indexes. They are dependant on the current position of the tabbed page. Prevent users from moving a tabbed page if either of these methods are overridden. The pageActivated and allowPageDeactivate methods do not pass any information on the current position of the tabbed page and allow full user setup.

tabChanged

Immediately before the change of the tabbed page.

If the method returns false, the system does not change the tabbed page.

Do not override this method.

For more information, see the tabChange method in this topic.

textChange

The user types in a field.

N/A

toolTip

The user points to the control with the mouse pointer.

N/A

validate

The user exits a control after entering data.

The super() call activates the validateField method on the database table.

Community Additions

ADD
Show:
© 2014 Microsoft