Re:Why Does Form Repaint?
The problem is that if the user moves the mouse cursor onto and off of
the Control (System) menu icon (without clicking), the form's OnPaint
event is triggered and the form is repainted.
I am using D3. The project uses several other forms; one other form
has the problem, but the others do not. The forms are all called
modally from the main form.
Here is the slimmed-down code for the form. What you see is the
complete code. I have deleted everything else so I could troubleshoot
the problem. ShowMessage is called from FormPaint so I can tell when
FormPaint is triggered.
-----------------------------------------------------
unit MWMapsSh;
interface
uses Forms;
type
TMapsDisplayForm = class(TForm)
procedure FormPaint(Sender: TObject);
private
public
end;
var MapsDisplayForm: TMapsDisplayForm;
implementation
uses Dialogs;
{$R *.DFM}
procedure TMapsDisplayForm.FormPaint(Sender: TObject);
begin
ShowMessage('In FormPaint');
end;
end.
------------------------------------------------------
In case you need it, here is the DFM file:
------------------------------------------------------
object MapsDisplayForm: TMapsDisplayForm
Left = 361
Top = 120
HelpContext = 15
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
ClientHeight = 404
ClientWidth = 573
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -15
Font.Name = 'Arial'
Font.Style = []
OnPaint = FormPaint
PixelsPerInch = 120
TextHeight = 17
end
------------------------------------------------------
Any ideas?