Insert text at cursus position
Posted: Mon Jul 11, 2016 3:22 pm
I have a RichviewEdit (already filled with text) and a Listbox with multiple items.
How can i drag and drop items from the ListBox and insert them onto the cursor position on the RichviewEdit?
I have made a start but this just add the string at the end...
How can i drag and drop items from the ListBox and insert them onto the cursor position on the RichviewEdit?
I have made a start but this just add the string at the end...
Code: Select all
procedure TNotaPerEmailSettingsForm.RichViewEdit1DragDrop(Sender,
Source: TObject; X, Y: Integer);
var s:string;
begin
s:='<<'+
FieldNamesBox.Items.Strings[FieldNamesBox.ItemIndex]+'>>';
with Source as TListBox do
begin
RichViewEdit1.add(s,0);
end;
RichViewEdit1.Format;
end;