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!

Form.Textout(..) disappear

Status
Not open for further replies.

Ilkkae

Programmer
Nov 24, 2003
1
SE
If I use form.canvas.textout(...) and after it for example use windows Date and Time, the text on form will disappear under Date and Time after I have closed it. It also disappear if minimize the window.
Well ! if I use textout in FormPaint it works for the last text but not for earlier text.
Hove to do ?
 
This is how it is meant to work.

When Windows wants an area of the screen to be redrawn it asks applications to "paint" various rectangles.

In Delphi applications you specify this painting in the FormPaint event.

If you do your Form.Canvas.TextOut ( 'XXX' ) outside of your FormPaint event then Windows does not know whether you want XXX to be painted or not when it needs to repaint a rectangle.

Most components, eg TStringGrid, know how to repaint themselves.

I don't really understand your question but I hope that this (simplified) reply helps.

Andrew
 
If you need persistent text on a form, just add a TLabel in appropriate places, and put the text in the Caption property, like in
Code:
 TLabel1.Caption := 'Hello world';
The TLabel knows how to redraw itself also

HTH
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top