![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 3 of 3 total |
![]() |
Thu, Oct 11 2018 10:14 PM | Permanent Link |
Paul Coshott | Hi All,
I have a TEdit (for email subject) and a TMultiLineEdit for email message. The user is able to use variables in both of these, by entering things like %STAFF_NAME%. I would like to allow the user to click on a Label and then insert the variable text into the TEdit or TMultiLineEdit at the current cursor position. Can anyone tell me how to do this? Thanks heaps, Paul |
Sat, Oct 13 2018 7:08 AM | Permanent Link |
Uli Becker | Paul,
> I would like to allow the user to click on a Label and then insert the variable text into the TEdit or TMultiLineEdit at the current cursor position. Can anyone tell me how to do this? For a TMultiLineEdit you can use the SelectionStart property, e.g.: procedure TForm1.Button1Click(Sender: TObject); var p: Integer; begin p := MultiLineEdit1.SelectionStart; MultiLineEdit1.Lines.Text := Copy(MultiLineEdit1.Lines.Text, 1, p) + ' %STAFF_NAME% ' + Copy(MultiLineEdit1.Lines.Text, MultiLineEdit1.SelectionStart+1, Length(MultiLineEdit1.Lines.Text)); end; With a TEdit component it won't work though. Uli |
Tue, Oct 16 2018 6:09 AM | Permanent Link |
Paul Coshott | Hey Uli,
>> MultiLineEdit1.Lines.Text := Copy(MultiLineEdit1.Lines.Text, 1, p) + ' %STAFF_NAME% ' + >> Copy(MultiLineEdit1.Lines.Text, MultiLineEdit1.SelectionStart+1, Length(MultiLineEdit1.Lines.Text)); >> end; Thanks heaps mate. Appreciate it. Cheers, Paul |
This web page was last updated on Friday, March 17, 2023 at 10:08 PM | Privacy Policy![]() © 2023 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |