Textbox length limit

N

Nebo

I have been trying to figure out how to get the TextBox to display
strings longer than the 60K limit. I have successfully sent messages
with EM_LIMITTEXT to control the editable limit. Also, I have loaded
the text box with WM_SETTEXT message. However, sadly when I reach a
certain point when scrolling into the textbox it just freaks out (cant
go any further, loops from top to bottom of page).

Any suggestions on increasing the editable limit with a large string?
 
P

Peter Foot [MVP]

You could use a WebBrowser control instead, or find an alternative way to
display your text so you don't load it all at once - I'm sure the user will
be pleased if they can avoid excessive scrolling.

Peter

--
Peter Foot
Microsoft Device Application Development MVP
peterfoot.net | appamundi.com | inthehand.com
APPA Mundi Ltd - software solutions for a mobile world
In The Hand Ltd - .NET Components for Mobility
 
C

Chris Tacke, eMVP

In what case would it ever be good to put that much data in a textbox? I'd
argue the answer is clearly "never." You certainly can't view that much
data at one time. This is like having a ListView with 200k lines in it.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
N

Nebo

It is a Text Editor and sometimes the files being opened are larger.
Is there a better control for this?
 
C

Chris Tacke, eMVP

Sure, but "opened" doesn't mean you have to load the whole file and put it
into the textbox. I have a desktop editor that can open a 1GB file in a
matter of seconds. I assure you it's not loading the whole thing and
stuffing it into the TextBox that is displayed.

You need to look at virtualization. A classic case is something like the
ListView with VirtualMode on (not supported in the CF, but the idea stands).
You need to load data for display *on demand* - generally holding only 3
"pages" of data at any given time: what you see, the page before and the
page after. When you get a scroll event you show the newly requested data
while pitching and fetching to the top or bottom of the data cursor.

No, I'm not aware of any control that does this out of the box, though I've
also never looked.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
M

Mark Erikson

It is a Text Editor and sometimes the files being opened are larger.
Is there a better control for this?

You could try looking into the Windows CE port of the Scintilla text
editor widget (http://www.scintilla.org). It's a C++ component, but I
was able to modify a C# wrapper to work with it on the PocketPC.
Don't have all the links and descriptions on hand at the moment, but
if you email me, I could try to round up what information I've got.

Mark Erikson
http://www.isquaredsoftware.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top