Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

blank line after every line 1

Status
Not open for further replies.

earlrainer

Programmer
Mar 1, 2002
170
IN
Hi,

I have a memo box on the form (you can also consider a rich edit box).

I want that when the user types in the memo box , that automatically a blank line is added after every line i.e it gives an effect of a double spaced letter.

I wrote on key down event that if key = 13 then memo1.lines.add('') but this adds a line at the bottom of the memo and does not allow me to enter a carriage retun in between of the memo box

how can i program this ?
 
hi

Hope this is helpful:

Just had a quick look at the help about using SelText and it says
" If there is no selection, but the edit control has focus, set SelText to insert a new string into the text at the cursor."

Sorry, I've never use SelText like this before.

lou

 
Hi Weez,

just thought I'd share this with you..got it from another forum..works as well

procedure TForm1.RichEdit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = 13 then
RichEdit1.Perform(WM_CHAR, 13, 0);
end;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top