vb.net 2008 文本框最大长度 [英] vb.net 2008 textbox max length

查看:43
本文介绍了vb.net 2008 文本框最大长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 vb.net 2008 中,最多可以放入一个文本框的字符数是多少?

What is the maximum amount of characters that can be put into a textbox in vb.net 2008?

推荐答案

假设 Windows 窗体:

Assuming Windows Forms:

TextBox.MaxLength

您可以使用此属性来限制在控件中输入的文本长度,例如邮政编码和电话号码.您还可以使用此属性来限制将数据存储在数据库中时输入的文本长度,使输入控件的文本不超过数据库中相应字段的最大长度.

You can use this property to restrict the length of text entered in the control for values such as postal codes and telephone numbers. You can also use this property to restrict the length of text entered when the data is to be stored in a database so that the text entered into the control does not exceed the maximum length of the corresponding field in the database.

此属性不影响以编程方式添加的字符.

This property does not affect characters that are added programmatically.

当该属性设置为0时,控件中可以输入的文本的最大长度仅受可用内存的限制.

When this property is set to 0, the maximum length of the text that can be entered in the control is limited only by available memory.

(但将如此多的数据放入一个文本框以填满所有可用内存并不是一个好主意.如果您有这么多数据,您将需要一个不同的用户界面.TextBox 不是为轻松查看/编辑而设计的如此大量的数据.)

(But it's not a good idea to put so much data into a textbox that it fills all available memory. If you have that much data, you will need a different user interface. The TextBox was not designed for easily viewing/editing such large amounts of data.)

这篇关于vb.net 2008 文本框最大长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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