Board index » delphi » TCustomControl doesn't always repaint

TCustomControl doesn't always repaint

I've created a descendent of a TCustomControl that does not work
consistently.  Normally, when another NewForm is shown over MyControl, I can
drag NewForm around the screen and MyControl will be repainted as expected.
Sometimes when I drag NewForm, MyControl is NOT repainted. The NewForm acts
just like the eraser in MS Paint....until MyControl is completely "rubbed
out".  Other labels, buttons, etc. on the main form are not rubbed out.

In either case, I'm using the same form, but the difference seems to be the
way that the NewForm is instantiated that is causing this problem.  When I
open the NewForm via a click on MenuItemNewForm, the repaint occurs
correctly.  When I open the NewForm from the middle of a procedure, via
MenuItemNewForm.OnClick(Self), the repainting does not occur.  In all other
respects, the program appears to be working correctly.

Does anyone have an idea what might be causing this behavior?

 

Re:TCustomControl doesn't always repaint


Which method are you overriding  to repaint your control?

--
Clairebear

http://www.corkyscave.com
http://www.faqs.org/faqs/usenet/emily-postnews/part1/

Quote
> MenuItemNewForm.OnClick(Self), the repainting does not occur.  In all
other
> respects, the program appears to be working correctly.

> Does anyone have an idea what might be causing this behavior?

Re:TCustomControl doesn't always repaint


I am overriding the Paint method.

Quote
"Clairebear" <nospam_clairebea...@ntlworld.com> wrote in message

news:jwXq8.5866$Ll2.780683@news6-win.server.ntlworld.com...
Quote
> Which method are you overriding  to repaint your control?

> --
> Clairebear

> http://www.corkyscave.com
> http://www.faqs.org/faqs/usenet/emily-postnews/part1/

> > MenuItemNewForm.OnClick(Self), the repainting does not occur.  In all
> other
> > respects, the program appears to be working correctly.

> > Does anyone have an idea what might be causing this behavior?

Other Threads