Hi... How do I get output debug messages generated by the debug mode (ie. Start with debugging)? If I can get them, I wish to display them to listbox that I have in the windows form I created. Is there a smarter way other than using the following? :

lstDebugMessage.Items.Add("Whatever is inside debug message");

Where lstDebugMessage is the listbox I generated in my windows form. Thanks for any ideas!

So, if I understand correctly, when an error is thrown you want to add the error Message (the text) to a listbox?

If so this should do it.

THis example the program trys to open that file, and since it doesnt exist, its add the error to the listbox.

                File.Open("C:\\dasdsds.txt",FileMode.Open);//Try to open

            catch (Exception error)

Hope that helps :).

Erm sorry... not error messages. Some of my dlls generate some data output that prints to the console output screen (also same as debug output screen). I want to read the console output messages that my dlls generate. Sorry for the misunderstanding...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.