Groups | Blog | Home
all groups > dotnet drawing api > june 2005 >

dotnet drawing api : Repaint form?



Michael
6/19/2005 4:27:01 PM
Hi!
I'm currently working on an editor form my 2D game engine which uses
polygons for collions detection. From the main form the user chose to create
a collision polygon and then an other form is show. This form is derived from
System.Windows.Forms.Form. Each time the user presses a mouse button a point
i is added to an ArrayList. The forms OnPaint method calls
Graphics.DrawPolygon() to draw the collision polygon (the graphics comes from
the PaintEventArges passed to the OnPaint handler). When a point is added I
want to repaint the entire form. I've tried using Refresh() and Invalidate()
but my application keeps throwing an exception. Any ideas why?

Bob Powell [MVP]
6/20/2005 8:55:25 AM
It'd be a good idea to post the exception and the stack trace.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





[quoted text, click to view]

AddThis Social Bookmark Button