Re: PaintBox image trouble



Ok, there is also a clock on the form. If I repaint the moon each minute, how should I organize it? The clock has the OnMinute event and the PaintBox the OnPaint event.

var s1, s2 :string;
(*****************************************************)
procedure TForm.FormShow(Sender: TObject);
begin
 CountMoon(s1,s2);
end;
{here the OnPaint paints the image as the form is shown in the beginning}

(************************************************************************)
procedure TForm.Clock1Minute(Sender: TObject; Minute: Word);
begin
 CountMoon(s1, s2);
 DrawMoon(s1,s2);
end;
{the PaintBox1 should be initialized here somehow}

(**********************************************************)
procedure TForm.PaintBox1Paint(Sender: TObject);
begin
DrawMoon(s1,s2);
end;


.



Relevant Pages

  • Re: React when the program isnt focused
    ... move the mouse-cursor over the clock. ... procedure TFormMain.LabelTime1MouseEnter(Sender: TObject); ... procedure TFormMain.LabelTime1MouseMove(Sender: TObject; Shift: ... the focused program so you probably already know my question: ...
    (comp.lang.pascal.delphi.misc)
  • Re: React when the program isnt focused
    ... procedure TFormMain.LabelTime1MouseEnter(Sender: TObject); ... procedure TFormMain.LabelTime1MouseMove(Sender: TObject; Shift: ... It works when the clock is the focused program. ...
    (comp.lang.pascal.delphi.misc)
  • React when the program isnt focused
    ... My clock-program shows a small, borderless window with the date when you move the mouse-cursor over the clock. ... procedure TFormMain.LabelTime1MouseEnter(Sender: TObject); ... But doesn't when the clock is not the focused program. ...
    (comp.lang.pascal.delphi.misc)