473,385 Members | 1,325 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,385 software developers and data experts.

Increasing limits of textbox

Hi group,

I have a form with a textbox control on it. I am using the textbox
control with multiline enabled to output the 'log' information for a
long process I am running. My problem is that it all works fine until
the limit of the size of text is reached for the text box. This causes
the textbox to stop update whilst the thread running the process
continues.

Any ideas how I can expand the functionality of the textbox to accept
larger amounts of data? I tried a richtextbox but it gives me the same
problem. Failing that, any ideas of a different control I could use
instead that comes with VB 2003?

I cannot use a listbox because I need the user to be able to highlight
sections of text or parts of text on one line and copy them to the
clipboard.

TIA

Nov 28 '05 #1
12 1340
"Hugh Janus" <my*************@hotmail.com> schrieb:
I have a form with a textbox control on it. I am using the textbox
control with multiline enabled to output the 'log' information for a
long process I am running. My problem is that it all works fine until
the limit of the size of text is reached for the text box. This causes
the textbox to stop update whilst the thread running the process
continues.

Any ideas how I can expand the functionality of the textbox to accept
larger amounts of data? I tried a richtextbox but it gives me the same
problem. Failing that, any ideas of a different control I could use
instead that comes with VB 2003?


Which amount of data are you writing to the control? Note that the machine
only has a limited memory. In addition to that, make sure you use
'Control.InvokeRequired', 'Control.Invoke'/'Control.BeginInvoke' to update
the control from another thread instead of accessing it directly, which will
cause problems because instance members of Windows Forms controls are not
safe for multithreading.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 28 '05 #2
> Which amount of data are you writing to the control? Note that the machine
only has a limited memory. In addition to that, make sure you use
'Control.InvokeRequired', 'Control.Invoke'/'Control.BeginInvoke' to update
the control from another thread instead of accessing it directly, which will
cause problems because instance members of Windows Forms controls are not
safe for multithreading.


It is not that much text, should not grow to more than 1 or 2 mb's of
pure text if it was saved as a text file in notepad, so memory should
not be a problem as far as I can tell. 2mb's is far greater than what
the Textbox or Richtextbox control can handle though. Any ideas?

p.s. I am using invoke to update the control already! thanks!

Nov 28 '05 #3
Hugh Janus wrote:
Which amount of data are you writing to the control? Note that the machine
only has a limited memory. In addition to that, make sure you use
'Control.InvokeRequired', 'Control.Invoke'/'Control.BeginInvoke' to update
the control from another thread instead of accessing it directly, which will
cause problems because instance members of Windows Forms controls are not
safe for multithreading.

It is not that much text, should not grow to more than 1 or 2 mb's of
pure text if it was saved as a text file in notepad, so memory should
not be a problem as far as I can tell. 2mb's is far greater than what
the Textbox or Richtextbox control can handle though. Any ideas?

p.s. I am using invoke to update the control already! thanks!


The textbox can easily handle that... unless you're running Win9x.
--
Rinze van Huizen
C-Services Holland b.v
Nov 28 '05 #4
I am running Windows XP. The textbox just stops scrolling after a
while and no new information is added. I thought that the limit was
32k???

Nov 28 '05 #5
"Hugh Janus" <my*************@hotmail.com> schrieb:
I am running Windows XP. The textbox just stops scrolling after a
while and no new information is added. I thought that the limit was
32k???


IIRC, 'AppendText' and 'SelectionStart' are still limited to 32 KB.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 28 '05 #6
That is preciesely what I am using. AppendText. Upon further testing,
it seems that RichTextBox it works OK (I guess when I originally tested
one I had an error in my code). The problem with a RTB is that it does
not scroll automatically. So, I use the ScrollToCaret method but it is
not very reliable.

I guess I'll have to work out some 'cheat' for scrolling the RTB.
Thanks.

Nov 28 '05 #7
"Hugh Janus" <my*************@hotmail.com> schrieb:
I guess I'll have to work out some 'cheat' for scrolling the RTB.


Adding a line to a richtextbox control and scrolling it into view
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=richtextboxscrolltobottom&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 28 '05 #8

Herfried K. Wagner [MVP] wrote:
"Hugh Janus" <my*************@hotmail.com> schrieb:
I guess I'll have to work out some 'cheat' for scrolling the RTB.


Adding a line to a richtextbox control and scrolling it into view
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=richtextboxscrolltobottom&lang=en>


:-) Thanks a lot! I'll give that a try!

Nov 28 '05 #9

Herfried K. Wagner [MVP] wrote:
"Hugh Janus" <my*************@hotmail.com> schrieb:
I guess I'll have to work out some 'cheat' for scrolling the RTB.


Adding a line to a richtextbox control and scrolling it into view
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=richtextboxscrolltobottom&lang=en>


If the .Enabled is set to False on the RTB, how could I scroll it??
Or, is there an alternative way of stopping the user from interacting
with the RTB but still have it scrolling?

Nov 28 '05 #10
"Hugh Janus" <my*************@hotmail.com> schrieb:
> I guess I'll have to work out some 'cheat' for scrolling the RTB.


Adding a line to a richtextbox control and scrolling it into view
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=richtextboxscrolltobottom&lang=en>


If the .Enabled is set to False on the RTB, how could I scroll it??
Or, is there an alternative way of stopping the user from interacting
with the RTB but still have it scrolling?


Maybe setting the control's 'ReadOnly' property to 'True' solves your
problem.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 28 '05 #11

Herfried K. Wagner [MVP] wrote:
"Hugh Janus" <my*************@hotmail.com> schrieb:
> I guess I'll have to work out some 'cheat' for scrolling the RTB.

Adding a line to a richtextbox control and scrolling it into view
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=richtextboxscrolltobottom&lang=en>


If the .Enabled is set to False on the RTB, how could I scroll it??
Or, is there an alternative way of stopping the user from interacting
with the RTB but still have it scrolling?


Maybe setting the control's 'ReadOnly' property to 'True' solves your
problem.


I have the property set to True already. The problem is that you can
still place the cursor in the box. If i set enabled to false then it
does not scroll. Not to worry as I worked out another way, albeit a
bit shoddy. I have a timer that checks to see if the cursor has been
placed in the box. if it is, it takes it out.

Nov 29 '05 #12
Hugh Janus wrote:

I have the property set to True already. The problem is that you can
still place the cursor in the box. If i set enabled to false then it
does not scroll. Not to worry as I worked out another way, albeit a
bit shoddy. I have a timer that checks to see if the cursor has been
placed in the box. if it is, it takes it out.


Instead of a timer, why don't you use the getfocus event? When the user
clicks in the box, it gets the focus, use that event to get rid of it again.
--
Rinze van Huizen
C-Services Holland b.v
Nov 29 '05 #13

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

Similar topics

6
by: Matik | last post by:
Hello all, I've following problem. Please forgive me not posting script, but I think it won't help anyway. I've a table, which is quite big (over 5 milions records). Now, this table contains...
100
by: jacob navia | last post by:
As everybody knows, C uses a zero delimited unbounded pointer for its representation of strings. This is extremely inefficient because at each query of the length of the string, the computer...
6
by: tshad | last post by:
I have a cell with 2 items in it: a textbox and a link. The link is actually a button (image), but for the example I am using a link, which is doing the same thing. Here is the stripped down...
2
by: Peter | last post by:
I hate using the mask edit conrol so I created these two function to format my phone numbers. Is there a way to consolidate these two functions into one? In this example say the textbox you...
15
by: Joe Lester | last post by:
I installed Postgres 7.4.1 on a dual processor G5 running Mac OS 10.3.2. I'm trying to increase the max_connections to 300 and running into some trouble. If anyone could shed some light, I'd...
2
by: Joseph Geretz | last post by:
I'm developing a Web Service using DIME to download and upload files from and to an IIS server. In order to increase the download filesize to unlimited, I have the following block in my App.config...
4
by: Rahul B | last post by:
Hi, I was getting the error: sqlcode: -911 sqlstate: 40001 , which is "The maximum number of lock requests has been reached for the database." So i increased the locklist size to 200 from the...
7
by: weg22 | last post by:
Hi all, I need to impose maximum and minimum numerical limits on a textbox. I'd prefer not to code these in (since I have many textboxes and the limits on each are different) and was wondering...
13
by: Josip | last post by:
I'm trying to limit a value stored by object (either int or float): class Limited(object): def __init__(self, value, min, max): self.min, self.max = min, max self.n = value def...
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...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.