Danny Tykon

When I use textbox.appendtext(buff), buff is successfully appended to the textbox and the textbox automatically scrolls.

However, there seems to be a limit... the scrolling stops (as does the data being appended) after a certain amount of data is appended.

I have the maxlength set to 0 and have also tried setting it to 1,000,000.

I have resorted to:

textbox.text+=buff
textbox.selectionstart=txtbox..text.length
textbox.scrolltocaret()

Unfortunately, that scrolls the text all the way to the beginning and then back to the end everytime which causes undesirable flashing.

Does anyone know why the appendtext method is limited



Re: Windows Forms General Textbox scrolling

Mark Benningfield

Hello All.

Danny:

I can't seem to duplicate your problem. I have no problem appending a 1,000,000 character string to a textbox. Could you post some code

HTH.






Re: Windows Forms General Textbox scrolling

Danny Tykon

        FileOpen(1, "c:\mlx\eventlogs\test.mlg", OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)

        txtMainOutput.AppendText(InputString(1, FileLen("c:\mlx\eventlogs\test.mlg")))

        FileClose(1)

i set the txtMainOutput.maxlength to 0 but the appendtext method seems to only append 32767 characters. The file is 6 megabytes.

 

Any help would be appreciated. THanks.!





Re: Windows Forms General Textbox scrolling

JRQ

VS2003: Textbox has approximately 32K chars limit. You can use a RichTextBox which depends on computer resources.



Re: Windows Forms General Textbox scrolling

Mark Benningfield

Hello All.

Danny:

Hmmm. What version of Visual Studio are you running And, if I'm not mistaken, InputString() has a max character count of 214, so it would be much simpler to use a My.Computer.FileSystem object to read the entire file into a string variable.

Your call to InputString() is not throwing an exception






Re: Windows Forms General Textbox scrolling

Danny Tykon

I have only encountered a limit problem when using the appendtext method. If I do output.text+=buff, everything works fine - no limit issue using a standard textbox.

The example was reading a file, if you simply coded a for loop to .appendtext a 1000 byte buffer 40 times, the text would only contain the first 32767 bytes.

I am using VS 2003.





Re: Windows Forms General Textbox scrolling

Danny Tykon

Everyone: Thanks for your help on this. I started really searching (google) this topic and found a number of posts relating to the 32767 limit of the appendtext method. Apparently this is pretty much a bug...

http://www.vergentsoftware.com/blogs/ckinsman/CommentView.aspx guid=2a268197-fe21-4e41-8cfd-ac9067b9a33c

I'll research the rich textbox control.

Thanks again