← Back to Index

TFlexFMXLetterSelector

Alphabetical index bar for quick navigation in long lists (like iOS Contacts).

Key Properties

Letters: string
Letters to display (default: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ#').
SelectedLetter: Char
Currently selected letter.
TextColor: TAlphaColor
Letter text color.
SelectedColor: TAlphaColor
Selected letter highlight color.
FontSize: Single
Letter font size.
Orientation: TOrientation
Vertical (default) or Horizontal layout.
ShowPopupHint: Boolean
Display large letter popup while dragging.
HapticFeedback: Boolean
Vibrate on letter change (mobile).

Usage Examples

Contacts List Navigation

LetterSelector1.Align := alRight;
LetterSelector1.Width := 30;
LetterSelector1.ShowPopupHint := True;
LetterSelector1.HapticFeedback := True;

procedure TForm1.LetterSelector1Change(Sender: TObject);
begin
  ScrollContactsToLetter(LetterSelector1.SelectedLetter);
end;

Custom Letters

// Include numbers and special character
LetterSelector1.Letters := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#';

// Only vowels
LetterSelector1.Letters := 'AEIOU';

Integration with ListView

procedure TForm1.ScrollToLetter(Letter: Char);
var
  I: Integer;
begin
  for I := 0 to ListView1.Items.Count - 1 do
  begin
    if UpperCase(ListView1.Items[I].Text)[1] = Letter then
    begin
      ListView1.ScrollToItem(I);
      Break;
    end;
  end;
end;

procedure TForm1.LetterSelector1Change(Sender: TObject);
begin
  ScrollToLetter(LetterSelector1.SelectedLetter);
end;

Horizontal Layout

LetterSelector1.Orientation := Horizontal;
LetterSelector1.Align := alTop;
LetterSelector1.Height := 40;

Events

Notes

← Back to Index