日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

c#中textbox属性_C#.Net中的TextBox.MaxLength属性与示例

發(fā)布時(shí)間:2023/12/1 50 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c#中textbox属性_C#.Net中的TextBox.MaxLength属性与示例 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

c#中textbox屬性

Here we are demonstrating use of MaxLength property of TextBox.

在這里,我們演示了TextBox的MaxLength屬性的使用。

MaxLength property of TextBox is used to set maximum number of character that we can input into a TextBox. Limit of MaxLength property is 1 to 32767. By default this property is set to 32767.

TextBox的MaxLength屬性用于設(shè)置可以輸入到TextBox中的最大字符數(shù)。 MaxLength屬性的限制為1到32767 。 默認(rèn)情況下,此屬性設(shè)置為32767 。

Example:

例:

In this example, we took a Windows form that contains a TextBox named txtInput, we are setting MaxLength to 4, that means we cannot enter character more than 4 in this TextBox.

在此示例中,我們采用了Windows窗體,其中包含一個(gè)名為txtInput的TextBox ,我們將MaxLength設(shè)置為4 ,這意味著我們不能在此TextBox中輸入超過(guò)4個(gè)字符。

Change the property using code:

使用代碼更改屬性:

private void Form1_Load(object sender, EventArgs e) {textInput.MaxLength = 4; }

翻譯自: https://www.includehelp.com/dot-net/textbox-maxlength-property-with-example.aspx

c#中textbox屬性

總結(jié)

以上是生活随笔為你收集整理的c#中textbox属性_C#.Net中的TextBox.MaxLength属性与示例的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。