Strange Up/Down Button Crash

I have a database application with a report viewer that uses a canvas to display table data by drawing the table data into a picture for the canvas paint event. If the table is too large for a single canvas I split the data into multiple pictures that are stored in a dictionary and listed as pages in a popup menu on the report viewer. I also have an up/down button next to the popup menu so that pages can be incremented and decremented. It works as expected when pages are selected from the popup menu but the app crashes randomly without catching errors if the popup menu listindex is changed using the up/down button. Any idea why that might be happening? I would expect a possible out of memory problem if the app were crashing from both the popup menu and the up/down button, but it only crashes when the up/down button is used, not the popup menu.

If I write the pictures as files to the temporary folder and open and draw them from the canvas paint event rather than store them in a dictionary the problem does not occur. Perhaps a memory leak problem involving one of the controls? If it’s an out of memory problem I would expect it to catch the exception error but the app just crashes. It’s a mystery.