开发者

silverlight textbox with equal space between leters

I'm developing an application for a bank, and I need a textbox for entering the money, like

silverlight textbox with equal space between leters

My Idea was to create a textbox that has as a background the image of the grid, and than I just set the text size such that there is only a character in each box. but writing iiiii(5 characters) is as long as wwww开发者_运维知识库 (4 characters). Can I set a font or a character spacing such hat i ensure that the characters writen in the textbox will appear in separate boxes.

Ps: there are other similar boxes for name, so I don't inpu only digits.


You could use monospace (fixed width) font, Courier for example. Or you could create custom control with TextBox for each character, but in this case you would have to implement big chunk of custom logic.


Using a Glyphs control, you can set indices for exact spacing of the characters of the UnicodeString property. Check this for details: http://msdn.microsoft.com/en-us/library/bb979862%28VS.95%29.aspx.

You can set the value for the UnicodeString in the code-behind or viewmodel if you are using MVVM.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜