Share via


Guide.BeginShowMessageBox Method

Begins the process of displaying a message box with the specified parameters. The display operation is performed asynchronously.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

public static IAsyncResult BeginShowMessageBox (
         PlayerIndex player,
         string title,
         string text,
         IEnumerable<string> buttons,
         int focusButton,
         MessageBoxIcon icon,
         AsyncCallback callback,
         Object state
)

Parameters

  • player
    Target player of the message box. On Windows, the only valid option is PlayerIndex.One.
  • title
    Title of the message box.
  • text
    Text of the message box.
  • buttons
    Captions for the message box buttons. The maximum number is three.
  • focusButton
    Zero-based index specifying which button has focus.
  • icon
    Type of icon displayed in the message box.
  • callback
    The method to be called once the asynchronous operation has finished.
  • state
    A user-created object uniquely identifying this request.

Return Value

An IAsyncResult used to track the progress of the method.

Exceptions

Exception type Condition
InvalidOperationException IsInitialized was not previously called or a Guide user interface screen is currently active.

Remarks

Bb975191.bp(en-US,XNAGameStudio.30).gifBest Practice

You can check GamerPrivileges.AllowCommunication to determine if a player is allowed to send and receive communications prior to displaying a menu option that would call this method.

See Also

Reference

GamerPrivileges.AllowCommunication Property
Guide Class
Guide Members
Microsoft.Xna.Framework.GamerServices Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista