I have a project have a textbox with password mode. But this must be show when it has focus and hide characters when it kills his focus.
This is my source code. m_editBox is control variable of IDC_EDIT1.
void CEditBoxTestDlg::OnEnSetfocusEdit1()
{
//m_editBox.SetPasswordChar(0);
}
void CEditBoxTestDlg::OnEnKillfocusEdit1()
{
//m_editBox.SetPasswordChar('*'); //1
m_editBox.SendNotifyMessage(EM_SETPASSWORDCHAR, (WPARAM) '*', NULL); //2
}
But OnEnKillfocusEdit() does not work clearly. I debugged it and I check enter this module.
How can I slove this problem. Thanks.
I did it myself. I missed Invalidate() function after sendmessage. And I checked SetpasswordChar(), SendNotifyMessage, PostMessage() are also work finely.
Here is my code:
Thanks.