【问题标题】:How to apply price format on a MaskedTextBox?如何在 MaskedTextBox 上应用价格格式?
【发布时间】:2020-07-13 19:07:03
【问题描述】:

一些关于如何在 MaskedTextBox 上应用价格格式的示例代码,启动时的掩码为 $0.00,并且在键入时从右到左替换第一个零开始,这将分隔数千,在winforms中,VS 2017。如图:

【问题讨论】:

  • 这能回答你的问题吗? Maskedtextbox money
  • 谢谢,但他们的回答是不能应用,我尝试用 C# 来做,因为在 Java 中是可能的

标签: c# winforms maskedtextbox


【解决方案1】:

您可以使用NumericUpDown 控件和Label 实现您想要的。

对于本例,我将NumericUpDown 的以下属性设置为:

DecimalPlaces = 2
ThousandsSeparator = True
Maximum = 100000000
TextAlign = Right

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-02-07
    • 2021-11-08
    • 1970-01-01
    • 1970-01-01
    • 2013-07-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多