How to Enable Password Mask in Editbox?
You have to enable ES_PASSWORD style of editbox and have to call SetPasswordChar() to set the Password masking character. You can do it in CDialog::OnInitDialog(). See the code snippet below.
BOOL CRabbitDlg::OnInitDialog()
{
...
// Get the Edit by using CtrlID.
CEdit* pEdit = (CEdit*) GetDlgItem( IDC_EDIT_PASSWORD );
// Set the password char.
pEdit->SetPasswordChar( '*' );
// Now modify the style to enable ES_PASSWORD.
pEdit->ModifyStyle( 0, ES_PASSWORD );
return TRUE;
}

0 comments:
Post a Comment