tags:

views:

4

answers:

1

I want to do what I have done in the past, using the old VB6. Subclassing has changed a lot since VB6 and I still want to do the same:

I need to intercept WM_PAINT of DataGridView, send it to a memory device context (to avoid flickering), make some visual changes, like place a logo over all over the grid. With VB6, was easy to do. I have spend hours trying to convert VB6/API code to Visual Basic Express 2010 code, without success.

So, if anybody know how to do it ... let me know please.

Thank's on advance

Abílio Rodrigues

A: 

You can't send messages to device contexts, only to windows. Get the handle of the window for the control, and send the message there.

Ignacio Vazquez-Abrams
Abílio Rodrigues
the upper code was made by myself in order to send WM_PAINT to a BackBuffer, using VB6, inside a Case WM_PAINT ...and it works ! However, i don't know how to use this code inside a OnPaint override. There are something left ...
Abílio Rodrigues
So in other words you're looking for `SendMessage()`?
Ignacio Vazquez-Abrams