本文介绍了仅数字文本框在Visual Studio工具箱控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想提出一个数字,只有文本框。我想然后添加相同的控件工具箱的Visual Studio 2008中的
I would like to make one numeric-only textbox. I'd like to then add that same to the control toolbox within Visual Studio 2008
我已经建立了功能,只允许数字。
I've already built the function to allow only numeric.
如何使它在工具箱中可用?
How can I make it available in the toolbox?
推荐答案这是如何创建数字文本框:
public class NumericTextBox : TextBox { protected override void OnKeyPress(KeyPressEventArgs e) { if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) { e.Handled = true; } base.OnKeyPress(e); } }更多推荐
仅数字文本框在Visual Studio工具箱控制
发布评论