仅数字文本框在Visual Studio工具箱控制

编程入门 行业动态 更新时间:2024-10-24 17:30:47
本文介绍了仅数字文本框在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工具箱控制

本文发布于:2023-11-17 05:24:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1608979.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:工具箱   文本框   数字   Visual   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!