> The problem is, after this window opens it gets hundreds (or thousands) of > Paint events, and I can't figure out why. .... > > I tried tracing the code with the debugger, and when it exits the Paint > method, the next step is right at the top of the Paint event again. > > Its almost impossible to trace problems like this in the debugger - because the paint event fires whenever the canvas is even partially obscurred by another window (e.g. the code window in the debugger). Unless you have two monitors and can put the code window on one monitor and the app window on another.
>DisplayWnd Paint Event >... Repeat DisplayWnd PaintEvent a few hundred times until I quit the >application... No, this is not the way you do it. You just display the paint event once - it stays up by itself and updates itself by itself. The standard way to do this is to make a "draw_my_canvas( g as graphics)" method. You call it from two places - your code when something changes on the canvas, and from the change event of the canvas itself. _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>