Posted June 27, 200718 yr 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
June 27, 200718 yr 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!
June 27, 200718 yr Author 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, 200718 yr by cegy
June 27, 200718 yr 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;
Create an account or sign in to comment