TabSheetBox.OnChangeCellContent

Syntax

Sub TabSheetBox1OnChangeCellContent(Sender: Object; Args: ITabCellContentChangeEventArgs);

Begin

//set of operators

End Sub TabSheetBox1OnChangeCellContent;

Parameters

Sender - a parameter, indicating the component, in which the event has occurred.

Args - a parameter, which allows to define a cell, which has been edited, as well as set some additional parameters.

Description

The OnChangeCellContent event occurs, if a table cell contents has been changed.

Comments

This event can be handled, for example, to get the formulas, entered by the user.

This event differs from the OnCellChange event in the following way: the OnCellChange event occurs only when table cell value is changed, whereas the OnChangeCellContent event occurs if value, text, or formula are changed in the table cell.

For example, the table cell has a value "5". If we enter in this cell a formula «=3+2», the value and text remain the same, and only a formula will have changed. Therefore, the OnCellChange event does not occur, only the OnChangeCellContent event occurs, as cell contents was changed, but cell value remains the same.

If cell formula was added or edited, so that cell value changes, the OnChangeCellContent event is called twice. When the event is called for the first time, the Value property of the Args parameter contains the entered formula, on the second time the Value property contains formula result.

Example

To execute the example, the procedure has to be set as an event handler to the OnChangeCellContent event for the TabSheetBox component with the TabSheetBox1 identifier.

Sub TabSheetBox1OnChangeCellContent(Sender: Object; Args: ITabCellContentChangeEventArgs);

Begin

If Args.Type = TabCellContentChange.Formula Then

WinApplication.InformationBox("A formula has been entered: " + Args.Value);

End If;

If Args.Type = TabCellContentChange.Value Then

WinApplication.InformationBox("Formula calculation result: " + Args.Value);

End If;

End Sub TabSheetBox1OnChangeCellContent;

If the value in the cell has changed on entering formula to the table cell, two messages will be displayed: first one with the formula text, and then with its calculation result.

See also:

TabSheetBox