Click here to Skip to main content
15,899,639 members
Home / Discussions / C#
   

C#

 
Questionoffice programming Pin
groundzero11127-Feb-07 6:38
groundzero11127-Feb-07 6:38 
QuestionVery fast textbox needed Pin
hellamasta27-Feb-07 6:04
hellamasta27-Feb-07 6:04 
AnswerRe: Very fast textbox needed Pin
Christian Graus27-Feb-07 9:22
protectorChristian Graus27-Feb-07 9:22 
GeneralRe: Very fast textbox needed Pin
hellamasta27-Feb-07 10:16
hellamasta27-Feb-07 10:16 
GeneralRe: Very fast textbox needed Pin
mike montagne27-Feb-07 10:38
mike montagne27-Feb-07 10:38 
GeneralRe: Very fast textbox needed Pin
Dan Neely27-Feb-07 10:51
Dan Neely27-Feb-07 10:51 
GeneralRe: Very fast textbox needed Pin
Mark T.27-Feb-07 12:03
Mark T.27-Feb-07 12:03 
AnswerRe: Very fast textbox needed Pin
Luc Pattyn28-Feb-07 3:03
sitebuilderLuc Pattyn28-Feb-07 3:03 
Hi,

I concur with Dan: a ListBox is a lot faster than a TextBox when large amounts of text
are involved.

But then you must be aware a Windows system is not a real-time system, under some
circumstances (garbage collection, floppy access, antivirus activated, high network
traffic, ...) it will be unable to cope with an external device producing data at a
high and uninterruptible rate. IMHO you should provide at least one of the following:
- a sufficient buffer inside the external device;
- a start/stop communication protocol;
- a retry facility

Some additional thoughts:
1. maybe you are only interested in the last N lines of information,
in that case organize the listbox in such a way that it throws away the oldest lines
when new lines come in, avoiding it to grow without limit.
2. once a control contains 100,000 lines of text it becomes practically useless: it
gets very hard to navigate, you typically dont find anything anymore.
3. you may reduce the CPU load caused by the listbox by using AddRange() instead of
Add() effectively adding say 10 lines at once; or by using SuspendLayout()/ResumeLayout()
so it gets redrawn only every say 10 lines.
4. you may improve performance (at the expense of more code) by disconnecting your data
source and the listbox: have your own buffer scheme (preferable a circular buffer)
holding the last N lines of text, which are NOT added to a listbox; and a listbox (or
a simple Panel) which acts as a low-frequency view on say a sliding windows of a fraction
of those N lines.

Smile | :)




Luc Pattyn

[My Articles]

GeneralRe: Very fast textbox needed Pin
hellamasta28-Feb-07 4:24
hellamasta28-Feb-07 4:24 
QuestionReplacing dll with the same name Pin
engsrini27-Feb-07 5:46
engsrini27-Feb-07 5:46 
AnswerRe: Replacing dll with the same name Pin
Not Active27-Feb-07 5:51
mentorNot Active27-Feb-07 5:51 
QuestionDisabling Treeview Problem Pin
Khoramdin27-Feb-07 5:31
Khoramdin27-Feb-07 5:31 
AnswerRe: Disabling Treeview Problem Pin
tgrt27-Feb-07 6:25
tgrt27-Feb-07 6:25 
QuestionIs there a Form.Shown Event equivalent in .Net 1.1? Pin
Zoltan Balazs27-Feb-07 5:26
Zoltan Balazs27-Feb-07 5:26 
AnswerRe: Is there a Form.Shown Event equivalent in .Net 1.1? Pin
kubben27-Feb-07 5:36
kubben27-Feb-07 5:36 
GeneralRe: Is there a Form.Shown Event equivalent in .Net 1.1? Pin
Zoltan Balazs27-Feb-07 5:48
Zoltan Balazs27-Feb-07 5:48 
GeneralRe: Is there a Form.Shown Event equivalent in .Net 1.1? Pin
kubben27-Feb-07 6:01
kubben27-Feb-07 6:01 
GeneralRe: Is there a Form.Shown Event equivalent in .Net 1.1? Pin
Zoltan Balazs27-Feb-07 6:03
Zoltan Balazs27-Feb-07 6:03 
GeneralRe: Is there a Form.Shown Event equivalent in .Net 1.1? Pin
kubben27-Feb-07 6:30
kubben27-Feb-07 6:30 
QuestionRemoting, Sockets, .... [modified] Pin
Saaaaz27-Feb-07 5:14
Saaaaz27-Feb-07 5:14 
AnswerRe: Remoting, Sockets, .... Pin
originSH27-Feb-07 6:20
originSH27-Feb-07 6:20 
GeneralRe: Remoting, Sockets, .... Pin
Saaaaz28-Feb-07 3:24
Saaaaz28-Feb-07 3:24 
QuestionWhat is the best solution for store html/javascripts Pin
Scripter4727-Feb-07 5:03
Scripter4727-Feb-07 5:03 
AnswerRe: What is the best solution for store html/javascripts Pin
Not Active27-Feb-07 5:10
mentorNot Active27-Feb-07 5:10 
QuestionRe: What is the best solution for store html/javascripts Pin
Scripter4727-Feb-07 5:24
Scripter4727-Feb-07 5:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.