[Overview][Types][Classes][Index] | Reference for unit 'GroupedEdit' (#lcl)

# TCustomAbstractGroupedEdit.FocusAndMaybeSelectAll

Gives focus to the control, and optionally selects text in its editor.

## Declaration

Source position: groupededit.pp line 185

`protected procedure TCustomAbstractGroupedEdit.FocusAndMaybeSelectAll;`

## Description

FocusAndMaybeSelectAll is a procedure used to give focus to the control, and to optionally select text in its editor. FocusAndMaybeSelectAll calls the SetFocus method in BaseEditor to ensure that the editor portion of the grouped edit control has focus.

The value in AutoSelect is used to determine the selected text in the BaseEditor control. When AutoSelect is set to True, the SelectAll method in BaseEditor is called to select all of the content in the control. When False, the SelStart method in BaseEditor is set to the maximum value for an Integer, ensuring that the caret position is located at the end of the control value.

FocusAndMaybeSelectAll is used in the implementation of the BuddyClick method.

## See also

TCustomAbstractGroupedEdit.BaseEditor |  | Represents the control used as the editor for the value in the grouped edit control.
TCustomAbstractGroupedEdit.AutoSelect |  | Indicates if the text in the control is automatically selected when focus is received.
TCustomAbstractGroupedEdit.BuddyClick |  | Performs actions needed when the Buddy control is clicked.
TCustomAbstractGroupedEdit.SelectAll |  | Selects all of the content in the control.
TCustomAbstractGroupedEdit.SelStart |  | Starting position for the current selection in the control.