gpt4 book ai didi

C# WinForm Keypress 在句号后只允许两个数字

转载 作者:太空宇宙 更新时间:2023-11-03 11:28:27 27 4
gpt4 key购买 nike

我有一个带按键的 WinForm,它允许个人在文本框中输入数字。

我允许用户输入一个句号,但我该怎么做才能让他们只能在句号后输入两个数字。例如“20.99”

最佳答案

MaskedTextBox正是这种情况存在控制。

The MaskedTextBox class is an enhanced TextBox control that supports a declarative syntax for accepting or rejecting user input.

关于C# WinForm Keypress 在句号后只允许两个数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8626099/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com