Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
UltraMaskedEdit PromptChar Rendering
posted

Howdy,

I have a particular need from the UltraMaskedEdit editor.  What I need it to do is render each prompt char differently; specifically, I need it to render the first prompt char with the digit '1', the second prompt char with the digit '2', etc, so that each prompt char gives a visual representation to the user what index of the input they are editing.

How I attempted to accomplish this was to bring in Infragistics' source to my project in order to make the PromptChar property virtual.  Then I created a child class of this UltraMaskedEdit and overrode the PromptChar property getter to increment the returned digit each time it was called.

However, the problem with this approach is that it seems that PromptChar is gotten many more times than I expected.  And more difficult is the fact that for in different circumstances, it seems to be called a different number of times so I can't know before hand how to accommodate for that.  Thus, my prompt chars are not what I expect.

Can someone tell me how to solve my problem?  Perhaps I'm going about things the wrong way.

 

Thanks a million!

Parents
  • 469350
    Suggested Answer
    Offline posted

    Perhaps you could use a DrawFilter, instead. Each character in the MaskedEdit control is displayed by a separate DisplayCharUIElement. It doesn't look like you can change the Text of the element, but you could use a DrawFilter to draw whatever you want.

    Not sure how you determine the character's position in the text, though, so that might be tricky. Maybe you can use the DisplayChar property on the element and use the rect of the element to determine it's relative position.

Reply Children
No Data