ComponentOne True DBInput Pro 8.0
CursorPosition Property (TDBMask)

 

Reference> TDBMask Control> TDBMask Control Properties> CursorPosition Property (TDBMask)

CursorPosition Property (TDBMask)

Sets/returns the cursor position (field) upon receiving focus.

Syntax

TDBMask.CursorPosition= integer

Read/Write at run time and design time.

Values

-1 ~ total field count -1 (-1 is the default)

Remarks

You can use this property to determine which field to locate the cursor on when receiving focus. You can also use the HighlightText property in combination to determine whether to select the field you locate on.

Since the total amount of fields are not fixed for the TDBMask control, the maximum value for the CursorPosition property will change. Field numbers ranging from 0 to the field count -1 are allowed.

If CursorPosition is set to -1 and HighlightText is set to 0-None, the cursor will be positioned according to the settings of the SelStart and SelLength properties. Note that as soon as the user clicks on the control, the SelStart and the SelLength settings are changed to the position clicked on.

If CursorPosition is set to -1 and HighlightText is set to 1-Field, a non-literal field determined by the SelStart property setting will be selected. However, if the SelStart position happens to be located on a literal, the next non-literal field will be selected. If the next non-literal field does not exist, then the previous field will be selected. Note that as soon as the user clicks on the control, the SelStart setting is changed to the position clicked on.

If CursorPosition is set to a zero-based field index and HighlightText is set to 0-None, the cursor will be positioned at the first character of the specified field.

If CursorPosition is set to a zero-based field index and HighlightText is set to 1-Field, the specified field will be selected and the cursor will be positioned at the far right.

If the HighlightText property is set to 2-All, the entire contents of the control will be selected, the cursor will be positioned at the far right, and the CursorPosition setting will be ignored.

If CursorPosition is set to an index number larger than the total field count, the cursor will be placed at the leftmost non-literal field.

When setting the Format property to a zero-length string, the text in the control will be treated as one field and the cursor will be placed at the leftmost position.

By default, the cursor will be placed on the first character of the first non-literal field.

See Also

HighlightText Property (TDBDate)

SelStart Property (TDBMask)

SelLength Property (TDBMask)

Format Property (TDBMask)

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback