默认文本框值集 [英] default textbox value set

查看:59
本文介绍了默认文本框值集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我有一个非常简单的问题?

如何在窗口形式的文本框中设置默认整数值。



谢谢

Hello,
I have a very simple ques?
How can I set a default integer value in a textbox, in window form.

Thanks

推荐答案

如果你只使用整数,那么我就不会使用文本框了 - 它很远用户太容易输入错误并输入您必须检查的数据并向他报告。



为什么不使用NumericUpDown?它只允许数字,你也可以设置最大值和最小值。



如果必须使用TextBox,那么只需在设计器中设置Text属性或表单Load事件。
If you are using integers only, then I wouldn''t use a Textbox - it''s far too easy for the user to mistype and enter data you have to check and report back to him on.

Why not use a NumericUpDown? It only allows numbers, and you can set a max and min value as well.

If you must use a TextBox, then just set the Text property in either the designer, or the form Load event.


这篇关于默认文本框值集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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