Is there a way to create Numberic Textboxes using WPF xaml code?

醉酒当歌 提交于 2020-02-26 00:54:51

问题


I am new to WPF. I need to create textboxes which is only accept digits. Not accepted any special characters, letters .

And the important thing is , the code is only xaml not c#.

I googled lot of websites , but i only get the code used c#. But i want in XAML code. Because i enclosed it like styles in controls.

Is there any way to do this? And if it is not possible Why?


回答1:


No, it's not possible because XAML is a markup language. It has no support for distinguishing between digits and other type of characters.

You should use a programming language such as C# to implement this kind of logic.



来源:https://stackoverflow.com/questions/60265339/is-there-a-way-to-create-numberic-textboxes-using-wpf-xaml-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!