How can I format a decimal bound to TextBox without angering my users?

前端 未结 3 1038
陌清茗
陌清茗 2020-12-23 19:20

I\'m trying to display a formatted decimal in a TextBox using data binding in WPF.

Goals

Goal 1: When setting a decimal property in code, display 2 decimal p

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-23 19:51

    Try the WPF Extended Tookit Masked TextBox to implement an Input Mask: http://wpftoolkit.codeplex.com/wikipage?title=MaskedTextBox

    Example:

    
    

提交回复
热议问题