本文介绍了面具面具文本框来回小数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用屏蔽文本框我希望屏蔽文本框最多取7位数和2位小数。 例如1234567.12。目前我使用mask作为ddddddddddd。在我的表中小数精度是9,2.so用户可以放8个数字,所以算术溢出异常即将来临。 可以有人建议掩盖这种情况。我也试过用ddddddd.dd但这也是不适用于我。
i am using masked text box i want the mask textbox to take max 7 digits and two decimals. for e.g 1234567.12.Currently i use mask as "dddddddddd".in my table the decimal precision is 9,2.so the user can able to put 8 digits so the arithmatic overflow exception is coming. can anybody suggest mask for this situation.i have also tried with ddddddd.dd but this is also not worked for me.
MaskedTextBox x:Name="TxtTransPort" Grid.Row="1" Width="78" Height="23" Margin="142,161,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" AllowSign="False" GroupNumerals="True" InputMask="ddddddd" IsEnabled="False" PromptChar=" " TextAlignment="Right" GotFocus ="TextBox_GotFocus"/>推荐答案
使用 0000000.00 掩码代替你的掩码,最大数字设置为 MaxLength 属性TextBox Use the 0000000.00 mask instead of yours, and max digits set with MaxLength property of TextBox
更多推荐
面具面具文本框来回小数
发布评论