Click here to Skip to main content
15,921,530 members
Home / Discussions / C#
   

C#

 
GeneralRe: display text in textbox Pin
OriginalGriff31-Jul-09 23:21
mveOriginalGriff31-Jul-09 23:21 
GeneralRe: display text in textbox Pin
Abdul Rahman Hamidy1-Aug-09 1:38
Abdul Rahman Hamidy1-Aug-09 1:38 
GeneralRe: display text in textbox Pin
Henry Minute1-Aug-09 2:10
Henry Minute1-Aug-09 2:10 
GeneralRe: display text in textbox Pin
OriginalGriff1-Aug-09 4:47
mveOriginalGriff1-Aug-09 4:47 
GeneralRe: display text in textbox Pin
DaveyM691-Aug-09 9:12
professionalDaveyM691-Aug-09 9:12 
GeneralRe: display text in textbox Pin
OriginalGriff1-Aug-09 22:24
mveOriginalGriff1-Aug-09 22:24 
GeneralRe: display text in textbox Pin
Abdul Rahman Hamidy1-Aug-09 18:07
Abdul Rahman Hamidy1-Aug-09 18:07 
GeneralRe: display text in textbox Pin
OriginalGriff1-Aug-09 22:22
mveOriginalGriff1-Aug-09 22:22 
I think you mean that your class generates a sequence of results, rather than a single result?
If so, then I would output them to a list and signal to the higher level that there were available.

Specifically, I would set up a queue in your class:
public Queue<string> qsOutputResults = new Queue<string>(100);

(Always create a queue with a minimum size or it gets extended the first time you use it)

Then when your results are available:
qsOutputResults.Enqueue(i.ToString());
OnChanged(null);


This adds the results to the queue and signals the results are ready.

In your form:
private void Changed(object sender, EventArgs e)            
   {            
   while (classMine.qsOutputResults.Count > 0)
      {
      tbResultsGoHere.AppendText(classMine.qsOutputResults.Dequeue());
      }
   }


Using the queue means they come off in the same order they went on.

If your form is too busy, they will just wait on the queue until you are ready.

You can replace the string with whatever is sensible for your results (of course).

You probably don't want to AppendText (it depends on your app) it was just for example.

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

GeneralRe: display text in textbox Pin
Abdul Rahman Hamidy2-Aug-09 1:01
Abdul Rahman Hamidy2-Aug-09 1:01 
GeneralRe: display text in textbox Pin
OriginalGriff2-Aug-09 1:24
mveOriginalGriff2-Aug-09 1:24 
GeneralRe: display text in textbox Pin
Abdul Rahman Hamidy2-Aug-09 17:54
Abdul Rahman Hamidy2-Aug-09 17:54 
QuestionGlobalAppointmentID Pin
248912831-Jul-09 22:12
248912831-Jul-09 22:12 
QuestionHow to caluclate the sum in datagridview Pin
Anjani Poornima31-Jul-09 20:59
Anjani Poornima31-Jul-09 20:59 
AnswerRe: How to caluclate the sum in datagridview Pin
dan!sh 31-Jul-09 21:43
professional dan!sh 31-Jul-09 21:43 
Questioncrystal report in c#.net Pin
Milind Panchal31-Jul-09 20:19
Milind Panchal31-Jul-09 20:19 
AnswerRe: crystal report in c#.net Pin
Abdul Rahman Hamidy31-Jul-09 22:58
Abdul Rahman Hamidy31-Jul-09 22:58 
AnswerRe: crystal report in c#.net Pin
nelsonpaixao1-Aug-09 5:38
nelsonpaixao1-Aug-09 5:38 
Questionobfuscation Pin
devvvy31-Jul-09 20:19
devvvy31-Jul-09 20:19 
AnswerRe: obfuscation Pin
mustang8631-Jul-09 22:13
mustang8631-Jul-09 22:13 
GeneralRe: obfuscation Pin
devvvy1-Aug-09 15:54
devvvy1-Aug-09 15:54 
AnswerRe: obfuscation Pin
Moreno Airoldi31-Jul-09 23:39
Moreno Airoldi31-Jul-09 23:39 
GeneralRe: obfuscation Pin
devvvy1-Aug-09 13:59
devvvy1-Aug-09 13:59 
GeneralRe: obfuscation Pin
Moreno Airoldi2-Aug-09 0:58
Moreno Airoldi2-Aug-09 0:58 
GeneralRe: obfuscation Pin
OriginalGriff2-Aug-09 1:30
mveOriginalGriff2-Aug-09 1:30 
GeneralRe: obfuscation [modified] Pin
mustang861-Aug-09 16:46
mustang861-Aug-09 16:46 

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.