Peter Kiers
asked on
Open a file in my notepad application with a specific fontname/size as default (part2)
Dear Experts,
In my previous question I got the comment that I had to be more specific about my problem.
My appologies.
I am Dutch and my English isn't very well. So I try to explain my problem:
I have made a Notepad that uses a TRichEdit. I want that when a user open's a text-file
(.doc . txt .rft) with my Notepad-application. The file will be showned in my Trichedit with
a default Fontname Arial and FontSize 14. And that the user can change the default fontname
and size in a MainMenu-item called Change default font.
I hope I have explaint my problem better this time.
I have received a good solution on my previous question, but I don´t know how to implement it.
Could someone help with it...
Greetings,
Peter
In my previous question I got the comment that I had to be more specific about my problem.
My appologies.
I am Dutch and my English isn't very well. So I try to explain my problem:
I have made a Notepad that uses a TRichEdit. I want that when a user open's a text-file
(.doc . txt .rft) with my Notepad-application. The file will be showned in my Trichedit with
a default Fontname Arial and FontSize 14. And that the user can change the default fontname
and size in a MainMenu-item called Change default font.
I hope I have explaint my problem better this time.
I have received a good solution on my previous question, but I don´t know how to implement it.
Could someone help with it...
Greetings,
Peter
procedure TForm1.LoadInRichEdit(FileName: string);
begin
RichEdit1.Clear;
RichEdit1.Font.Name := 'Arial';
RichEdit1.Font.Size := 14;
RichEdit1.Lines.LoadFromFile(FileName);
end;
ASKER
yes, now we have to set a default fontname and size
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank for all the help
procedure TForm1.Button6Click(Sender
begin
if FontDialog1.Execute then
RichEdit1.Font := FontDialog1.Font;
end;
is it what you looking for?
p.s. Ik dacht dat alle Nederlanders praat engels heel goed;)
ziolko.