目录

# 事件

在「事件」选项卡页面上，您可以为在表单控件字段中发生的事件指定相应的宏。

事件发生时，链接的宏将被调用。要将宏指定给事件，请按「...」按钮。将打开「指定动作」对话框。

要访问此命令...

Open context menu of a selected form element - choose Control Properties - Events tab.

Open Form Design toolbar, click Control Properties icon - Events tab.

对于不同的控件，发生的事件也不同。「事件」选项卡页面上仅列出对于选中控件和上下文来说可能发生的事件。
以下事件已定义:

## 批准操作

This event takes place before an action is triggered by clicking the control. For example, clicking a "Submit" button initiates a send action; however, the actual "send" process is started only when the When initiating event occurs. The Approve action event allows you to kill the process. If the linked method sends back FALSE, When initiating will not be executed.

## 执行操作

The Execute action event occurs when an action is started. For example, if you have a "Submit" button in your form, the send process represents the action to be initiated.

## 已修改

The Changed event takes place when the control loses the focus and the content of the control has changed since it lost the focus.

## 文字已修改

The Text modified event takes place if you enter or modify a text in an input field.

## 项目状态已修改

The Item status changed event takes place if the status of the control field has changed, for example, from checked to unchecked.

## 在瞄准时

The When receiving focus event takes place if a control field receives the focus.

## 在偏离目标时

The When losing focus event takes place if a control field loses the focus.

## 按下按键

The Key pressed event occurs when the user presses any key while the control has the focus. This event may be linked to a macro for checking entries.

## 已释放键

The Key released event occurs when the user releases any key while the control has the focus.

## 鼠标在内部

The Mouse inside event takes place if the mouse is inside the control field.

## 按下按键时鼠标移动

The Mouse moved while key pressed event takes place when the mouse is dragged while a key is pressed. An example is when, during drag-and-drop, an additional key determines the mode (move or copy).

## 鼠标移动

The Mouse moved event occurs if the mouse moves over the control.

## 已按下鼠标按钮

The Mouse button pressed event occurs if the mouse button is pressed while the mouse pointer is on the control.

请注意，此事件也可用于通知控件上弹出式右键菜单的请求。

## 已释放鼠标按钮

The Mouse button released event occurs if the mouse button is released while the mouse pointer is on the control.

## 鼠标在外部

The Mouse outside event takes place when the mouse is outside the control field.

### 更新之前

The Before update event occurs before the control content changed by the user is written into the data source. The linked macro can, for example, prevent this action by returning FALSE.

### 更新之后

The After update event occurs after the control content changed by the user has been written into the data source.

### 重置之前

The Prior to reset event occurs before a form is reset. Returning True approves the reset, returning False cancels the operation.

如果出现下列条件之一，表格会被重置:

1. 用户确认一个被定义为复位按钮的 (HTML) 按钮。

2. 在链接到数据源的表格中创建新的空白记录。例如，在最后的记录中按下「下一个记录」按钮。

### 重置之后

The After resetting event occurs after a form has been reset.