Q:

How do I get the error icon used by DataGridImageCell?

I display some objects that have thumbnails in two ways: one in a DataGridView, and one in a custom control.
In the DataGridView, the thumbnail is displayed in a DataGridViewImageCell.  If the thumbnail is missing, the cell displays an error icon.
I want to show that icon in my custom control, too.  How do I get hold of it?  Preferably without pinvoke, but beggars can't be choosers.

A:

I'd recommend turning this problem on its head: make sure the grid never displays the error icon. You should be able to do this by catching the cell data display event. If the image is missing, display an image from your resource segment (and use the same image in the custom control, obviously).
The problem with attempting to match the grid's built-in error image is that if the image gets changed in a future version, you'll have to modify your application.

