- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 vc++ 的新手,我的应用程序中需要一个密码字段
。我使用以下代码创建了编辑文本框,但不知道如何创建密码字段和按钮控件。
CreateWindow(L"EDIT", L"hello", WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT |
ES_AUTOHSCROLL | ES_WANTRETURN, 350, 500, 130, 20, hwnd, NULL, NULL, NULL);
任何帮助将不胜感激。谢谢
最佳答案
尝试 ES_PASSWORD :
Displays an asterisk (*) for each character typed into the edit control. This style is valid only for single-line edit controls.
Windows XP: If the edit control is from user32.dll, the default password character is an asterisk. However, if the edit control is from comctl32.dll version 6, the default character is a black circle.
To change the characters that is displayed, or set or clear this style, use the EM_SETPASSWORDCHAR message.
Note Comctl32.dll version 6 is not redistributable but it is included in Windows XP or later. To use Comctl32.dll version 6, specify it in a manifest. For more information on manifests, see Enabling Visual Styles.
编辑
你是说创建一个按钮?通过Using Buttons :
HWND hwndButton = CreateWindow(
L"BUTTON", // Predefined class; Unicode assumed.
L"OK", // Button text.
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
0, // x position.
0, // y position.
50, // Button width.
50, // Button height.
hwnd_parentwindow,
NULL, // No menu.
(HINSTANCE)GetWindowLong(hwnd_parentwindow, GWL_HINSTANCE),
NULL);
关于visual-studio-2010 - 如何在vc++中创建密码字段和按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4712330/
我是一名优秀的程序员,十分优秀!