QuantumJimbo
asked on
Getting the font Style from TFontStyle
Hi,
I'm quite new to Delphi so I expect this is a very n00b question, however how do you retrieve the Bold, Italic etc. settings with TFontStyle from a Font Dialog?
I've tried Form1.TFontDialog1.Font.St yle.fsItal ic but that doesn't work :(
Also is there a way of getting just the name of the style, like 'Bold' or 'Regular'?
Thanks,
James
I'm quite new to Delphi so I expect this is a very n00b question, however how do you retrieve the Bold, Italic etc. settings with TFontStyle from a Font Dialog?
I've tried Form1.TFontDialog1.Font.St
Also is there a way of getting just the name of the style, like 'Bold' or 'Regular'?
Thanks,
James
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thats just what I needed to know, Thanks!
procedure TForm1.Button1Click(Sender
begin
if FontDialog1.Execute then begin
button1.Font.Name := FontDialog1.Font.Name;
button1.Font.Color := FontDialog1.Font.Color;
button1.Font.Size := FontDialog1.Font.Size;
button1.Font.Style := FontDialog1.Font.Style;
end;
end;
if you just want the FontDialog1 to return text strings instead of TFont properties, you can change them using :
edit1.text := ColorToString(FontDialog1.
etc... Im not sure what the others wold be though...
hope this helps