C#文本框限制 [英] c# textbox limit

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

问题描述

你好,
我在使用文本框时遇到了一个奇怪的问题.
当我逐行填写文本框时,我看到行数或字符数没有限制(几乎),但是当我使用EngMatLib评估Matlab表达式(返回4000个字符字符串)时,我看到文本框无法显示整个字符串并将其截断.
看起来文本框的每行限制为大约4000个字符.我该如何克服这个问题之王?

预先感谢

Luca

Hi there,
I''m having a strange problem with a textbox.
When I fill-in the textbox line by line I see that there is not limit in the number of lines or chars (almost) but when I use the EngMatLib to evaluate a Matlab exrpession (which returns a 4000 chars string) I see that the textbox is not able to show the entire string and truncates it.
It looks like there is a limit of about 4000 chars per single line of a textbox. How can I overcome this king of problem?

thanx in advance

Luca

推荐答案

除非您进行了更改,否则TextBox中单行的MaxLength默认为32K.可能不是文本框会给您带来此问题,请尝试将数据粘贴到记事本或类似物中,然后先查看它是否可以正常工作.
或者,您的文本是多行,文本框是单行吗?
Unless you have changed it, the MaxLength for a single line in a TextBox defaults to 32K. It may not be the textbox which is giving you this problem, try pasting your data into notepad or similar and see if it works there first.
Alternatively, is your text multiline, and your textbox single line?


TextBox MaxLength是 32767
将TextBox1 MultiLine 设置为True
并运行您的应用.
TextBox MaxLength is 32767,
Set TextBox1 MultiLine as True
And Run your app.


只需将MAXLength属性设置为所需的所需长度
Simply set the MAXLength property to the desired length you required


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

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