如何使用 Visual Basic 2010 将 DataGridView WM_PAINT 消息直接发送到 DC(设备上下文)? [英] How can I send a DataGridView WM_PAINT message, directly to a DC (device context), using Visual Basic 2010?

查看:24
本文介绍了如何使用 Visual Basic 2010 将 DataGridView WM_PAINT 消息直接发送到 DC(设备上下文)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做我过去做过的事情,使用旧的VB6.自 VB6 以来,子类化发生了很大变化,我仍然想做同样的事情:

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:

我需要截取 DataGridView 的 WM_PAINT,将其发送到内存设备上下文(以避免闪烁),进行一些视觉更改,例如在整个网格上放置 徽标.使用VB6,很容易做到.我花了几个小时试图将 VB6/API 代码转换为 Visual Basic Express 2010 代码,但没有成功.

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.

提前致谢

阿比利奥·罗德里格斯

推荐答案

您不能将消息发送到设备上下文,只能发送到窗口.获取控件的窗口句柄,并将消息发送到那里.

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.

这篇关于如何使用 Visual Basic 2010 将 DataGridView WM_PAINT 消息直接发送到 DC(设备上下文)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆