Windows mobile 如何创建透明的ListView控件
如何开发一个没有背景的列表视图,以便正确显示我的背景图像。。。我无法看完这篇…看看这篇文章,其中有一个支持alpha混合的工具,您可以将它扩展到ListView控件。您可以用与win32相同的方法来完成 您所需要做的就是对控件进行子类化,并覆盖Windows mobile 如何创建透明的ListView控件,windows-mobile,Windows Mobile,如何开发一个没有背景的列表视图,以便正确显示我的背景图像。。。我无法看完这篇…看看这篇文章,其中有一个支持alpha混合的工具,您可以将它扩展到ListView控件。您可以用与win32相同的方法来完成 您所需要做的就是对控件进行子类化,并覆盖WM_ERASEBKGND窗口消息。您还可以覆盖WM_CTLCOLOR消息,将文本模式设置为透明 我在几乎所有的标准控件上都这样做过,效果很好 更新: 这是MFC中的一个开始示例,您仍然需要通过某种方法将背景绘制到控件上 class Transpa
WM_ERASEBKGND
窗口消息。您还可以覆盖WM_CTLCOLOR
消息,将文本模式设置为透明
我在几乎所有的标准控件上都这样做过,效果很好
更新:
这是MFC中的一个开始示例,您仍然需要通过某种方法将背景绘制到控件上
class TransparentListView : public CListView
{
public:
TransparentListView();
virtual ~ToolsListCtrl();
protected:
afx_msg HBRUSH CtlColor(CDC* /*pDC*/, UINT /*nCtlColor*/);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
private:
DECLARE_MESSAGE_MAP();
};
IMPLEMENT_DYNAMIC(TransparentListView , CListView)
TransparentListView::TransparentListView()
{
}
TransparentListView::~TransparentListView()
{
}
BEGIN_MESSAGE_MAP(TransparentListView, CListView)
ON_WM_CTLCOLOR_REFLECT()
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()
HBRUSH TransparentListView::CtlColor(CDC* pDC, UINT /*nCtlColor*/)
{
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
BOOL TransparentListView::OnEraseBkgnd(CDC* pDC)
{
// You will need to force the drawing of the background here
// onto the pDC, there are lots of ways to do this.
// I've done it my having a pointer to a interface that
// draws the background image
return TRUE;
}
你能告诉我你的方法吗?这将非常有帮助。。。