无法使用WS_BORDER样式创建CWnd对象 [英] Can't create CWnd object with WS_BORDER style

查看:81
本文介绍了无法使用WS_BORDER样式创建CWnd对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我的问题很容易解释.在基于对话框的应用程序中,我使用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!

推荐答案

我自己找到了解决方案,这里是:

I''ve found the solution myself, here it is:

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 ;)


请尝试使用CreateEx或ModifyStyleEx
Try using CreateEx or ModifyStyleEx


这篇关于无法使用WS_BORDER样式创建CWnd对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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