如何将编辑控件转换为密码类型。 [英] How to convert edit control to password type.

查看:102
本文介绍了如何将编辑控件转换为密码类型。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Edit控件,我想将其更改为密码类型。我怎么能以编程方式做到这一点?

我使用的是Visual C ++(MFC应用程序)



我尝试了什么:



代码我用过

I am having a Edit control and I want to change it to password type. How I can do it programmatically ?
I am using Visual C++ (MFC application)

What I have tried:

Code I have used

CEdit* pEdit = ( CEdit* ) GetDlgItem( IDC_.... );
pEdit->ModifyStyle( 0, ES_PASSWORD );





但是这段代码不起作用。



But this code is not working.

推荐答案

参见我想动态地添加/删除ES_PASSWORD(CEdit)样式。 [ ^ ]。


另请参阅 EM_SETPASSWORDCHAR消息(Windows) [ ^ ]。


这篇关于如何将编辑控件转换为密码类型。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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