C#-FORM: Using MessageBoxes with an MDI.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zimdanen
    New Member
    • Feb 2008
    • 6

    C#-FORM: Using MessageBoxes with an MDI.

    I am trying to use NUnit for testing, at the insistence of a coworker. In order to test the code, I are using an MDI (also at the insistence of that coworker) so that I can get to the forms that I create. I am having difficultly because I use MessageBoxes to let the user know certain things, but I do not know how to get to them to have them automatically clicked using NUnit.

    So my question is, how can I use MessageBoxes with an MDI? Or do I need to create my own MessageBox class and use that?

    Also, it is necessary that the MessageBoxes (as they do normally) disallow the user from doing anything else while they are popped up on the screen (which I am unsure of how to do if I create my own MessageBox class).

    Thanks,

    zimdanen
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    If you only need to show a string in the message box, then you should stick to using the MessageBox class provided with the framework.

    DialogResult result = MessageBox.Show ("I am a string");

    you can use the other overloaded metods of the MessageBox.Show method.

    If you want to change behavious according to what the user clicked int he mewssagebox, that will be provoded by DialogResult "result"

    Comment

    Working...