面具面具文本框来回小数

编程入门 行业动态 更新时间:2024-10-12 22:26:12
本文介绍了面具面具文本框来回小数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用屏蔽文本框我希望屏蔽文本框最多取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

更多推荐

面具面具文本框来回小数

本文发布于:2023-11-02 03:45:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551279.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:面具   小数   文本框   来回

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!