Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2012-03-30
2
Medium Priority
?
205 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

610 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