Tuesday, November 08, 2011 5:16 AM
I want to create an edit control for password inputting, and the contents must be centered in the edit box(single line).
I'm working on a windows CE project, so ES_CENTER is only supported when the ES_MULTILINE flag be set.
But when I use ES_CENTER | ES_MULTILINE | ES_PASSWORD styles to create the edit box, it can not change my inputs into asterisk(*)!
Mybe we can not combine ES_MULTILINE with ES_PASSWORD, but anybody could tell me why? And any idea about how to center the password inputs under windows ce 6.0 use c++?
Thank you !
- Edited by -Lily- Tuesday, November 08, 2011 5:17 AM
Tuesday, November 08, 2011 3:11 PM
If that combination doesn't work as expected, you can draw the edit control yourself using owner draw or custom draw techniques.
- Proposed As Answer by Jesse JiangMicrosoft Contingent Staff, Moderator Thursday, November 10, 2011 8:10 AM
Tuesday, November 15, 2011 2:55 AM
Thank you for your advise. But Edit Control doesn't support owner draw or custom draw techniques.
Tuesday, November 15, 2011 2:53 PM
You're correct. Okay, then you could try overriding WM_PAINT and WM_ERASEBACKGROUND. It's more work than custom draw (you now have to paint the entire control yourself), but should still get you to the same place.
Fortunately, the edit control is about the simplest control in terms of graphics. Just a rectangle with a white background.
- Marked As Answer by Jesse JiangMicrosoft Contingent Staff, Moderator Monday, November 21, 2011 7:40 AM