Determine number of characters entered into textbox with C#

后端 未结 4 1386
甜味超标
甜味超标 2021-01-22 20:24

Hi I was wanting to display the number of characters entered into a textbox and I want it to update as I type how can I go about this?

Here is what I have:



        
相关标签:
4条回答
  • 2021-01-22 20:37

    How about

    int jj = textBox1.Text.Length;
    

    Or am I missing something?

    0 讨论(0)
  • 2021-01-22 20:37

    you can use the OnTextChanged event of the Textbox on the client side in Javascript and compute the increment from.

    0 讨论(0)
  • 2021-01-22 20:42

    TextBoxobject.Text.Length will give you the length of textbox value.

    0 讨论(0)
  • 2021-01-22 20:51

    The text of the text box will be a string, so it has a Length property, i.e.:

    textBox1.Text.Length
    
    0 讨论(0)
提交回复
热议问题