locked
Edit Control can not display characters as an asterisk when I use ES_MULTILINE | ES_PASSWORD styles RRS feed

  • Question

  • Hello everyone

        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 !

       Lily

       


    • Edited by -Lily- Tuesday, November 8, 2011 5:17 AM
    Tuesday, November 8, 2011 5:16 AM

Answers

  • 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.

    -PaulH

    • Marked as answer by Jesse Jiang Monday, November 21, 2011 7:40 AM
    Tuesday, November 15, 2011 2:53 PM

All replies

  • If that combination doesn't work as expected, you can draw the edit control yourself using owner draw or custom draw techniques.

    see: http://msdn.microsoft.com/en-us/library/ms364048%28v=vs.80%29.aspx

    -PaulH

    • Proposed as answer by Jesse Jiang Thursday, November 10, 2011 8:10 AM
    Tuesday, November 8, 2011 3:11 PM
  • Hi PaulH

        Thank you for your advise. But Edit Control doesn't support owner draw or custom draw techniques.

       

    Tuesday, November 15, 2011 2:55 AM
  • 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.

    -PaulH

    • Marked as answer by Jesse Jiang Monday, November 21, 2011 7:40 AM
    Tuesday, November 15, 2011 2:53 PM