14064 Command ignored while in paint event
Cause
This error occurs if the paint code of a control or form attempts to use the refresh, refreshNow, or clearGraphics method. These methods cause another paint to be generated that would then cause another paint that would again call these methods, and so on. This would cause a never-ending paint situation that would probably also cause a stack overflow. As the next paint of your control or form will generate another error, the application will probably need to be terminated and then restarted before the code can be corrected.
Action
Remove the calls to these methods for paint events.