Solved

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

Posted on 2012-03-30
2
194 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now