cegy Posted June 27, 2007 Posted June 27, 2007 Hi, am a n00b to delphi but i've been trying to making a small program so good so far but the only problem i am having is that i want to be able to change the font colour and the tmemo background colour and not sure how to do this. many thanks
SHKODRAN Posted June 27, 2007 Posted June 27, 2007 Hi, am a n00b to delphi but i've been trying to making a small program so good so far but the only problem i am having is that i want to be able to change the font colour and the tmemo background colour and not sure how to do this. many thanks It's very easy!! Right click on the Tmemo -->Wiev as Text For the font color change Font.Color = clYellow,white ,Black ,Red For the Background change Color = Enjoy!
cegy Posted June 27, 2007 Author Posted June 27, 2007 (edited) oh i forgot to say so the user can pick any colour he wants to user from the colour dialog on both the font and background colour i might ask on how to do the font size aswell not to sure yet. Can u make it abit more easyer to understand aswell so i can understand thanks for the quick reply Edited June 27, 2007 by cegy
CyberLord Posted June 27, 2007 Posted June 27, 2007 Put a memo on a form. Then put three buttons on that form, one text box and one color dialog. For the OnClick event handlers of the buttons, put this code :change memo's background color :procedure TForm1.Button1Click(Sender: TObject);begin // execute the color dialog ColorDialog1.Execute(); // change memo's background color to the color that the user picked Memo1.Color := ColorDialog1.Color;end; change memo's font color :procedure TForm1.Button2Click(Sender: TObject);begin // execute the color dialog ColorDialog1.Execute(); // change memo's font color to the color that the user picked Memo1.Font.Color := ColorDialog1.Color;end;change memo's font size :procedure TForm1.Button3Click(Sender: TObject);begin// change the memo's font size to the size entered in the textboxMemo1.Font.Size := StrToInt(Edit1.Text);end;
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now