When doing the window form application assignment, just find out that after MessageBox::Show, the window form will lose its focus.

Reason:

Member name Description
ServiceNotification The message box is displayed on the active desktop.
DefaultDesktopOnly The message box is displayed on the active desktop.
RightAlign The message box text is right-aligned.
RtlReading Specifies that the message box text is displayed with right to left reading order.

Because once you use one of the two top options, the focus will move to previous active application.

Solution:

Just simply remove the MessageBoxOptions in MessageBox::Show call.

Reference:

http://msdn.microsoft.com/en-us/library/system.windows.forms.messageboxoptions.aspx

Apply to:

C++/CLI

Tagged with:
 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>