April 3rd, 2011, 08:43 AM
Diplaying an arraylist from an xml in a Dialog MessageBox
Hi everyone, my first time posting in this forum. Glad to see that it exists! Here is my problem:
I am creating a program that reads from an xml file and then displays that information in a Dialog MessageBox. The program is designed to kill running processes. I am using Visual Studio Professional 2010 and programming in C#.
I want the MessageBox to come up immediately when the program runs (which it does) so I put it in the Form1_Load. Then entire program runs well except I can't display the arraylist in the MessageBox without getting errors. Any and all suggestions would be welcome. Thanks for looking. Here is the code:
NOTE: oReadXML is the arraylist. I have commented it out in the code as you will notice in order to run the program and test that everything else works.
private void Form1_Load(object sender, EventArgs e)
//displays arraylist in a dialog messagebox
DialogResult dlgResult = MessageBox.Show(/*oReadXML.ToString(),*/ "Do you wish to kill these processes?",
"Continue", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dlgResult == DialogResult.Yes)
//kills the processes listed
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!