Closing modal dialog causes main window to flash/flicker

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ageejas1

    Closing modal dialog causes main window to flash/flicker

    Hello and thanks for any help
    I've noticed that my main application window has a bad Flash/Flicker sometimes when I close a modal dialog box. Sometimes it also loses focus, and gets placed behind another window that was not originally on top. I perform the dispose inside of the dialog, for instance when a user clicks on the Ok button as follows

    private void okButton_Click( object o, EventArgs e

    /*Perfrom some action*
    this.Dispose()


    Does anyone know why this is happening? Thanks.
  • Claire

    #2
    Re: Closing modal dialog causes main window to flash/flicker

    Have you tried calling Close() rather than dispose?


    Comment

    • Close worked.

      #3
      Re: Closing modal dialog causes main window to flash/flicker

      Thanks for the response Claire,

      That seemed to do the trick and things close a lot cleaner. I guess the Close() methods forces a paint before other calculations are done or something. Well, either way, thanks alot.

      Jason Agee

      Comment

      Working...