locked
How to get the parent window form displayed first then dialog box next RRS feed

  • Question

  • Hello EveryOne,

    I have a window form and a dialog box form when the window form is loaded if any error occurs it display the dilaog box first.i want like it should display the form first and above that it should display error dialog.is there any property for doing that?.

    waiting for suggestions....

    Thanks & Regards

    Natiq

    Friday, July 27, 2012 7:09 AM

Answers

All replies

  • Hello EveryOne,

    I have a window form and a dialog box form when the window form is loaded if any error occurs it display the dilaog box first.i want like it should display the form first and above that it should display error dialog.is there any property for doing that?.

    waiting for suggestions....

    Thanks & Regards

    Natiq

    • Merged by Chester Hong Monday, July 30, 2012 1:59 AM duplicate
    Friday, July 27, 2012 7:09 AM
  • Hello EveryOne,

    I have a window form and a dialog box form when the window form is loaded if any error occurs it display the dilaog box first.i want like it should display the form first and above that it should display error dialog.is there any property for doing that?.

    waiting for suggestions....

    Thanks & Regards

    Natiq

    • Merged by Chester Hong Monday, July 30, 2012 1:58 AM duplicate
    Friday, July 27, 2012 7:10 AM
  • Something like this?

    protected override onLoad( ... ) 
    { 
       CustomDialog dlg = new( CustomDialog( ... ) ); 
       
       // Make sure the Form is shown first ...
       this.Show(); 
       
       // ... then show the dialog
       dlg.ShowDialog(); 
    } 



    Regards, Phill W.

    Friday, July 27, 2012 11:25 AM
  • Use the Form.Shown event, instead of Form.Load.

    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.blogspot.com/

    • Proposed as answer by Chester Hong Monday, July 30, 2012 2:01 AM
    • Marked as answer by Chester Hong Friday, August 3, 2012 5:17 AM
    Friday, July 27, 2012 12:43 PM
  • Hello, without more details you could store the error message in a form level variable (thinking you would have a Try/Catch in the form load event) then in the form shown event display the message from the private variable. You would check to see if the form level variable has a value, if so that is when to display the message.

    KSG

    Saturday, July 28, 2012 4:34 AM