CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2009

    Cross-Thread MessageBox Bring to Front

    This should be simple maybe over looking something here.

    Have a form that loads for my progress display
    The form creates a thread to run my version checks against the server and grab updated info.
    Within this thread once it is complete there is a MessageBox to display hey i'm finished or here is your error.
    I want this MessageBox to be in front of my other 2 forums.

    In the actual IDE the message box is on top of everything. Running outside the IDE the MessageBox falls below both the main forum and the form with the progress animation.

    So I have tried using
    MessageBox.Show(new Form() {TopMost = true}, "blah blah", "blah blah");
    Again works in the IDE not outside the IDE.
    This is being tested on Win7 Pro x86

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004

    Re: Cross-Thread MessageBox Bring to Front

    One of the MessageBox.Show method overloads takes an IWin32Window param.

    Set this to the window of one of the other forms. Not sure if this will work cross thread, but you can try it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.