• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

Check Maximum of Characters of A Line At Multiple Line Textbox.

Hi All,

I want to control user input of a multiple line text box for maximum characters per line.

How could I do it ?

Thank you.
0
emi_sastra
Asked:
emi_sastra
1 Solution
 
CodeCruiserCommented:
Winforms? Try handling the key up event of textbox, break the text into lines

Dim Lines As String() = txtInput.Text.Split(VBCRLF)

Then check if any of the lines is beyond the maximum then either strip it out show an error

For Each Line In Lines
   If Line.Length > 10 Then
      msgbox "Error"
   End If
End If
0
 
emi_sastraAuthor Commented:
Hi CodeCruiser,

Great.

For Each Line In Lines
   If Line.Length > 10 Then
      msgbox "Error"
   End If
Next

Thank you very much for your help.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now