ActiveControl

This property returns the control that has the focus.

Syntax

object.ActiveControl

Parameters

object
Reference to a Form object or the Screen object.

Remarks

The ActiveControl property is read-only; it is unavailable at design time. A run-time error occurs if all controls on the form are invisible or disabled.

Each form can have an active control, regardless of whether or not the form is active. When a form is referenced, ActiveControl specifies the control that would have the focus if the referenced form were active.