我的API调用不会创建透明的列表视图 [英] My API calls don't create transparent list view as they should
问题描述
大家好!
我想首先感谢所有花时间查看此主题并尝试提供帮助的人。
我使用以下API制作了透明背景的列表视图:
SendMessage(GetDlgItem(hwnd,IDC_LIST1),LVM_SETBKCOLOR,(WPARAM) 0 ,
(LPARAM)CLR_NONE);
一切正常,所以我只是想让列表视图项的背景透明。
我尝试使用以下API,希望达到同样的效果:
SendMessage(GetDlgItem(hwnd,IDC_LIST1),LVM_SETTEXTBKCOLOR,(WPARAM) 0 ,
(LPARAM)CLR_NONE);
项目 背景每次将文字添加到项目中时, 变为黑色 但其子项目是透明的 a它们应该是。
我尝试过使用自定义绘图,虽然我之前从未做过自定义绘制,指定CLR_NONE,作为文本的背景,但效果是一样的。
一切正常,如果我指定一些正常颜色作为列表视图的背景,但如果我尝试使用CLR_NONE,我总是在列表视图的项目中获得黑色背景(再次,子项目被正确绘制)。
请帮忙,有一些建议/代码示例/链接/教程,我怀疑我可以自己解决这个问题。 br />
这就是全部,再次感谢所有想要帮助的人。
我在MS工作Visual Studio Express 2008,在Windows XP上,在C ++中,使用纯WIN32 API。
如果需要任何其他信息(源代码或类似的东西),请索取它,我将非常乐意提供它。
谷歌叔叔知道所有
你看到了CP 文章?
看看:在C#中,如何使listview背景透明
Hello everyone!
I would like to start by saying thanks to everyone who takes some time to view this thread and try to help.
I have made a list view with transparent background using following API:
SendMessage( GetDlgItem( hwnd, IDC_LIST1 ), LVM_SETBKCOLOR, (WPARAM)0,
(LPARAM)CLR_NONE );
Everything works fine, so I just wanted to make list view item's background transparent as well.
I have tried using the following API, hoping to achieve the same effect:
SendMessage( GetDlgItem( hwnd, IDC_LIST1 ), LVM_SETTEXTBKCOLOR, (WPARAM)0,
(LPARAM)CLR_NONE );
Items background becomes black every time text is added to the item, but its subitems are transparent as they should be.
I have tried using custom draw, although I have never done custom draw before, specifying CLR_NONE, as text's background, but the effect is the same.
Everything works fine, if I specify some "normal" color as list view's background, yet if I try with CLR_NONE, I always get black background in list view's items( again, subitems are painted correctly ).
Please help, with some suggestions/ code examples/ links/ tutorials, I doubt I can solve this on my own.
That would be all, thanks again to everyone who will try to help.
I work in MS Visual Studio Express 2008, on Windows XP, in C++, using pure WIN32 API.
If any other information is required ( source code or something similar ), please ask for it, I will more than gladly supply it.
Uncle Google knows all
Did you see the CP article ?
Take a look at : In C#, how to make listview background Transparent
这篇关于我的API调用不会创建透明的列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!