473,396 Members | 2,061 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,396 software developers and data experts.

Problem displaying 40,000 - 60 char entries in a text box.

Ty
I have a problem that should be relatively easy to fix but the solution just
seems to elude me.

I am creating a Windows app that contains a text box that I wish to fill
with data from a file. The file contains approximately 40k, 60 character
entries and it is taking an enormous amount of time to load the file contents
into the text box. Is there some way to speed this up?

I am currently reading an entry from the file and using the code:
FileNameTextBox.Text += sFileEntry;
to display the entry.

Thanks,
Ty
Mar 14 '06 #1
4 1492


"Ty" wrote:
I have a problem that should be relatively easy to fix but the solution just
seems to elude me.

I am creating a Windows app that contains a text box that I wish to fill
with data from a file. The file contains approximately 40k, 60 character
entries and it is taking an enormous amount of time to load the file contents
into the text box. Is there some way to speed this up?

I am currently reading an entry from the file and using the code:
FileNameTextBox.Text += sFileEntry;
to display the entry.

Thanks,
Ty


I faced a similar problem a while ago and did this:

StringBuilder sb = new StringBuilder();
// Append the 40,000 entries to sb
FileNameTextBox.Text += sb.ToString();

Worked great for me!

I hope this helps.
-Jeff
Mar 14 '06 #2
Jeff wrote:
StringBuilder sb = new StringBuilder();
// Append the 40,000 entries to sb
FileNameTextBox.Text += sb.ToString();


That really should be:

SringBuilder sb = new StringBuilder(2400000);
// Append the 40,000 entries to sb
FileNameTextBox.Text += sb.ToString();
--
Truth,
James Curran [erstwhile-MVP]
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
Mar 15 '06 #3
Ty wrote:
I am creating a Windows app that contains a text box that I wish to
fill with data from a file. The file contains approximately 40k, 60
character entries and it is taking an enormous amount of time to load
the file contents into the text box. Is there some way to speed this
up?

Well, I'm not sure if it well be any faster, but I'll bet this will be
more useable:
put them in a listbox.
--
Truth,
James Curran [erstwhile-MVP]
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
Mar 15 '06 #4
Hello Ty,

Are u really need all data being showed on the screen? Seems no. Just fill
that box async in the form start, thus fillin' of the box will be performed
in the background

T> I have a problem that should be relatively easy to fix but the
T> solution just seems to elude me.
T>
T> I am creating a Windows app that contains a text box that I wish to
T> fill with data from a file. The file contains approximately 40k, 60
T> character entries and it is taking an enormous amount of time to load
T> the file contents into the text box. Is there some way to speed this
T> up?
T>
T> I am currently reading an entry from the file and using the code:
T> FileNameTextBox.Text += sFileEntry;
T> to display the entry.
T> Thanks,
T> Ty
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 15 '06 #5

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

Similar topics

8
by: Brandon McCombs | last post by:
This may be the wrong group but I didn't see anything for VC++ so I'm trying here. I have a C++ book by Deitel and Deitel that says I can use fstream File("data.dat", ios::in | ios::out |...
4
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
Hey, Well, I have a Problem. I have designed a table which has few fields which are being declared in the database of type .... char of length 10. and other fields with varchar 50 and...
20
by: Development - multi.art.studio | last post by:
Hello everyone, i just upgraded my old postgres-database from version 7.1 to 7.4.2. i dumped out my 7.1 database (with pg_dump from 7.1) as an sql-file with copy-commands and to one file using...
3
by: Chris H | last post by:
Ok in the following code I am trying to have my keywards meta tag auto insert the top 10 titles from most recently added database entries, right now the while loop is only setting the $keyword...
5
by: H J van Rooyen | last post by:
Hi, I am struggling to get the pack method to do what I intend. I am trying to display user input in a seperate window, along with a little description of the field, something like this: ...
5
by: dav3 | last post by:
I am by no means an ultra slick programmer and my problem solving skills.. well they leave much to be desired. That being said I have been working on the following problem for the past few days and...
5
by: Chad | last post by:
say my input file is $ more suck ______ < gnu? > ------ \ , , \ /( )` \ \ \___ / | /- _ `-/ '
0
by: cappa | last post by:
hi, i've some problem to print to screen and save date in mysql if the entries contain char like à,è... i try to read some post but i'm not able to solve my problem. i use easyphp 1.8 with...
3
by: Robert Bevington | last post by:
Hi all, I ran into memory problems while tying to search and replace a very large text file. To solve this I break the file up into chunks and run the search and replace on each chunk. This...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.