[]
Gets or sets the index of default active editable field. This is a dependency property.
public int DefaultActiveFieldIndex { get; set; }
Public Property DefaultActiveFieldIndex As Integer
Type | Description |
---|---|
int | An int value indicates the default active field. |
The DefaultActiveFieldIndex represents the index of the editable field. When the control got focus, the default active field will be activated. The value should be greater than -1. When user set a value greater than the index of last editable field, the last editable field will be activated when control get keyboard focus.
The following sample show how to use DefaultActiveFieldIndex to move caret position to the second editable field when mask1 got focus.
GcMask mask1 = new GcMask();
mask1.FieldSet.Fields.AddRange("\D{3}-\D{4});
mask1.DefaultActiveFieldIndex = 1;
Type | Condition |
---|---|
ArgumentException | The assigned value is less than -1. |