Solved

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

Posted on 2012-03-30
2
197 Views
Last Modified: 2012-03-30
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
Comment
Question by:emi_sastra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 37787941
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
 
LVL 1

Author Closing Comment

by:emi_sastra
ID: 37789560
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with exporting to excel 4 44
Help with preventing downloading a zip file 10 49
Iteration Help (Asp.net VB) 5 36
Error message when using PrintSocket.Send 7 26
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question