Re: C#) How to keep drawing graphics by GDI

Tech-Archive recommends: Fix windows errors by optimizing your registry



To get redraw the rectangles or whatever your doing, you have to call
Invalidate() method. For minimizing or overrap... use the bellow
method.

protected override void DefWndProc(ref Message m)
{
if (m.Msg == 0x47)//WM_WINDOWPOSCHANGED
{
this.Invalidate();
}

base.DefWndProc(ref m);
}


As you've heard, you should paint on the Paint event. ( you'll have
the graphics into PaintEventArgs e properties). And maybe instead of a
form you should use a UserControl... :)\
Hope this helps

.



Relevant Pages

  • Re: Draw image on panel c#
    ... windows that it should notify you every time the Paint event is called. ... You can do this by subscribing to the event, or in case you inherit from a Control, by overriding the event. ... protected override void OnPaint ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Draw image on panel c#
    ... windows that it should notify you every time the Paint event is called. ... You can do this by subscribing to the event, or in case you inherit from a Control, by overriding the event. ... protected override void OnPaint ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Screen Refresh Event
    ... > On screen refresh the Paint event is fired. ... protected override void OnPaint ... Darrell ...
    (microsoft.public.dotnet.languages.csharp)