VB.net - WPF - xaml - 输入TextBox - 仅限数字 [英] VB.net - WPF - xaml - input TextBox - only numbers

查看:99
本文介绍了VB.net - WPF - xaml - 输入TextBox - 仅限数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要限制文本框仅输入数字(正数,负数和小数)并忽略其他数字。我不知道。



i need limit a text box input only numbers (positive, negative and decimals) and ignore others. I dont know.

<TextBox x:Name="LgDt" HorizontalAlignment="Left" Height="15" Margin="150,31,0,0" Text="0" VerticalAlignment="Top" Width="30" FontSize="10" MaxLines="1" MaxLength="10" TextOptions.TextHintingMode="Animated" TextAlignment="Right">





i需要vb.net中的代码。



att 。 Selmar



i need a code in vb.net please.

att. Selmar

推荐答案

请参考下面的类似Q& A。



http://www.vbforums.com/showthread.php?628693-RESOLVED-Validate-textbox-for-numeric-and-decimal-only [ ^ ]







http://stackoverflow.com/questions/17505008/numeric-textbox-in-c-sharp-wpf [ ^ ]





http://stackoverflow.com/questions/ 4085471 / alllow-only-numeric-entry-in-wpf-text-box [ ^ ]
Please refer below for similar Q&A.

http://www.vbforums.com/showthread.php?628693-RESOLVED-Validate-textbox-for-numeric-and-decimal-only[^]



http://stackoverflow.com/questions/17505008/numeric-textbox-in-c-sharp-wpf[^]


http://stackoverflow.com/questions/4085471/alllow-only-numeric-entry-in-wpf-text-box[^]


这篇关于VB.net - WPF - xaml - 输入TextBox - 仅限数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆