If you need to know what portion of the text a user selected in a TMemo (or TEdit) component, right after the selection was made, you can use the next code in the OnMouseUp event handler for a TMemo (named Memo1 in the code below) control:
~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TForm1.Memo1MouseUp(
Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer) ;
var
selection : string;
begin
selection := Memo1.SelText;
ShowMessage('Text selected: ' + selection)
end;
~~~~~~~~~~~~~~~~~~~~~~~~~
Delphi tips navigator:
» How to move the mouse cursor to the focused control when the form is displayed
« How to add leading zeroes to a number

