如何使用退格键创建数字文本框并按Enter ...? [英] How to Create numeric textbox with backspace and Enter...?

查看:64
本文介绍了如何使用退格键创建数字文本框并按Enter ...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建一个带有退格键的数字文本框,并且Enter可以正常工作...?

请帮帮我..

在此先感谢您.

How can I create a numeric textbox with backspace and Enter is working perfectly...?

Please help me ..

Thanks in Advance..

推荐答案

您可以覆盖现有文本框,然后根据需要处理键事件.
请参见此处 [
You can override the existing textbox and then handle key events as you require.
See here[^] for an example.


有关处理选项,请输入System.Windows.Forms.TextBox.AcceptsReturn. WPF中也有类似的事情.退格键没有问题,它总是应该起作用.如果没有,请显示您的代码.你可能会搞砸,我不知道是什么.

当然,只有当Multiline属性的值是true时,trueAcceptReturn才有意义.金,谢谢您的重要提示.

—SA
For options of processing Enter, look at System.Windows.Forms.TextBox.AcceptsReturn. There is a similar thing in WPF. There is not problem about backspace, it always should work. If not, show your code; you could have screw up, I don''t know what.

Of course, AcceptReturn of true only makes practical sense when the value of Multiline property is true. Kim, thank you for this important note.

—SA


这篇关于如何使用退格键创建数字文本框并按Enter ...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆