c#中textbox属性_C#.Net中的TextBox.MaxLength属性与示例
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屬性用于設置可以輸入到TextBox中的最大字符數。 MaxLength屬性的限制為1到32767 。 默認情況下,此屬性設置為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窗體,其中包含一個名為txtInput的TextBox ,我們將MaxLength設置為4 ,這意味著我們不能在此TextBox中輸入超過4個字符。
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屬性
總結
以上是生活随笔為你收集整理的c#中textbox属性_C#.Net中的TextBox.MaxLength属性与示例的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: 黄金多少钱一克回收啊?
 - 下一篇: ubuntu路由器联网_路由器及其协议简