本文介绍了格式化文本框以使用实时输入的值替换设置的占位符值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 以下是我想用C#存档的内容。 我有一个文本框,我将用它来输入金额。 当前我手动输入全部金额,包括小数,例如10.05 我想要达到的目标是在文本框中设置0.00的默认值,这样如果我按下一个数字,例如55,文本框自动替换默认0.00值的前2个零,显示0.55而不受我的任何人工干扰。 如果我输入3355,它必须自动显示为33.55实时,因为我正在键入解决方案 Below is what I am trying to archive in C#.I have a textbox that I will be using to enter an amount.Current I am entering the full amount manually including the decimal e.g. "10.05"What I want to achieve is to have a default value on the textbox of "0.00" such that if I press a number e.g. 55, the textbox automatically replaces the first 2 zeros of the default "0.00" value to display "0.55" without any manual interference from me.If I enter 3355, it has to automatically get displayed as 33.55 real time as I am typing 解决方案 这篇关于格式化文本框以使用实时输入的值替换设置的占位符值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-27 23:41