473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

block number of lines in a textbox

Hi all,

How can I block the number of lines that the user entered in a texbox, I
need that the user enter only 4 lines of text.

how can I block this and not permit that the user copy other text with more
than 4 lines into the textbox too.

Thanks in advance,

Fabio
Nov 20 '05 #1
2 1682
Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChange
If TextBox1.Lines.Length > 4 The
Dim newLines(3) As Strin
For i As Integer = 0 To
newLines(i) = TextBox1.Lines(i
Nex
TextBox1.Lines = newLine
End I
End Sub
Nov 20 '05 #2
Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChange
If TextBox1.Lines.Length > 4 The
Dim newLines(3) As Strin
For i As Integer = 0 To
newLines(i) = TextBox1.Lines(i
Nex
TextBox1.Lines = newLine
End I
End Sub
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: inkapyrite | last post by:
Hi all. I'm using ifstream to read from a named pipe but i've encountered an annoying problem. For some reason, the program blocks on reading an ifstream's internal buffer that's only half-filled....
2
by: TadPole | last post by:
Hi all, My main problems are::::::::: 1. Set a value within a block container that can be used and changed by subsequent templates/block-containers/tables etc.. 2. get/determine/find the...
2
by: ZZ | last post by:
Is there any limitaion of the number of lines for TextBox? How many lines can a TextBox have? Thanks!
0
by: Fabio | last post by:
Hi all, How can I block the number of lines that the user entered in a texbox, I need that the user enter only 4 lines of text. how can I block this and not permit that the user copy other...
9
by: LeAnne | last post by:
If the user types some text into a rich textbox, i need to know how many lines there are in the control. Note, I'm not interested in counting the number of the carriage returns or line feeds. ...
0
by: Eric | last post by:
Visual C++ 2005 Express MVP's and experience programmer's only please!... I need to get the number of lines in a textbox so I can insert them into a listview. The text comes from my database...
0
by: Eric | last post by:
Visual C++ 2005 Express MVP's and experience programmer's only please!... I need to get the number of lines in a textbox so I can insert them into a listview. The text comes from my database...
6
by: ivan.perak | last post by:
Hello, im a beginner in VB.NET... The thing i would like to do is as it follows.... I have a text file (list of names, every name to the next line) which is about 350000 lines long. I would...
1
by: luttkens | last post by:
I want i textbox to fit a specic amount of chars and lines. I'm using font Courier New, where all the letter has the same width. Since different DPI-setting changes the font-size I want to set the...
4
by: Daniel | last post by:
Hello, I need to access the code inside of a context manager, i.e. the call to with myManager(v=5) as x: a=b c=sin(x) should cause the following output (minus the first line, if that's...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.