class CGXPasswordControl: public CGXEditControl
The CGXPasswordControl class implements a text input control for passwords. When the user modifies the text, a password character (e.g., an asterisk, '*') will be shown for each entered character.
You can determine the password text with GetValueRowCol() programmatically.
Style attributes which specify the appearance of the cell are:
-
Text with SetValue.
-
Text color with SetColor.
-
Background color with SetInterior.
-
Cell frame 3d-effect (raised, inset, normal) with SetDraw3dFrame.
-
Borders with SetBorder.
-
Horizontal alignment with SetHorizontalAlignment.
-
Vertical alignment with SetVerticalAlignment.
-
Font with SetFont.
-
Read only with SetReadOnly.
-
Maximal text length with SetMaxTextLength.
- default id for CGXPasswordControl controls is GX_IDS_CTRL_PASSWORD.
If you want to change the password character you have to register the control in the OnInitialUpdate routine.
Example:
CGXPasswordControl* pPwdControl = new CGXPasswordControl(this,
GX_IDS_CTRL_PASSWORD);
pPwdControl->m_chPasswordChar = _T('@'); // use @ as password char
RegisterControl(GX_IDS_CTRL_PASSWORD, pPwdControl);
and later apply it to cells with
SetStyleRange(CGXRange(4,3,10,5),
CGXStyle()
.SetControl(GX_IDS_CTRL_PASSWORD)
);
#include <gxall.h>
See Also
CGXGridCore::RegisterControl CGXStyle::SetControl CGXStyle