hey...
how to do the message box that can show all the data out..without clicking many times..?
Means that i do one program in for loop.Let said i do 5 times looping. After I run the program, i dun need to clicking 5 times to show the result one by one. What i need is show all the result in One message box, so i no need to click so many times...

thanks for helping...

System.
System.Text.StringBuilder sb = new System.Text.StringBuilder();

for (int i = 1; i <= 10; i++)
  {
   sb.AppendLine(string.Format("Value : {0}", i));
  }
MessageBox.Show(sb.ToString());
Comments
You are a great questiontranslator!

How to modify this code.. so that the result will show in one messageBox and no need click so many times..

                IDictionaryEnumerator enu = sortList.GetEnumerator();

                while (enu.MoveNext())
                {
                    MessageBox.Show(enu.Value.ToString(), enu.Key.ToString());
                }

Edited 3 Years Ago by mike_2000_17: Fixed formatting

Comments
This question is redundant. Apply the same logic you were given in adatapost's post.

First construct a string sb in your while loop, just as adatapost pointed out.
Then call MessageBox.Show(sb) after the loop.

First construct a string sb in your while loop, just as adatapost pointed out.
Then call MessageBox.Show(sb) after the loop.

not really understand... can u explain in detail? thanks ya....

What do you not understand?

Let's say you have a problem with your car.
It is insufficient to say: " I have a problem.", "I do not understand." etc. etc.

Tell us more something like this: "I have a problem with my car, its four wheels are missing, can anyone help me to understand how I can fix that?" "Thanks for any help"

Edited 5 Years Ago by ddanbe: n/a

This article has been dead for over six months. Start a new discussion instead.