问题描述
大家好
我的问题很容易解释.在基于对话框的应用程序中,我使用CWnd::Create
函数创建控件.它正确地创建了它,但是没有边框,我已经在CWnd::Create
调用中添加了WS_BORDER样式,但是没有变化,它仍然没有边框.我尝试过依附ModifyStyle(0, WS_BORDER)
,但再没有结果.我已经搜索了这个问题,但是什么都没发现.
Hi All
My problem is simple to explain. In my dialog based app I create a control using CWnd::Create
function. It creates it propperly but with no border, I''ve added WS_BORDER style to the CWnd::Create
call but no change, it''s still without border. I''ve tried clling ModifyStyle(0, WS_BORDER)
but no result again. I''ve googled the problem but nothing came out.
Any help will be appreciated!
推荐答案
CWnd::CreateEx(WS_EX_CLIENTEDGE, "STATIC", "", uiFlags, refRect, pParent, uiID);
因此,如果您要创建带有凹陷边框的控件,其样式为WS_EX_CLIENTEDGE
而不是WS_BORDER
;)
So if you want to create control with sunken border that the style is WS_EX_CLIENTEDGE
not WS_BORDER
;)
这篇关于无法使用WS_BORDER样式创建CWnd对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!