Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 正在读取guide.beginshowmessagebox的结果_C#_Vb.net_Windows Phone 7_Windows Phone 8_Xna - Fatal编程技术网

C# 正在读取guide.beginshowmessagebox的结果

C# 正在读取guide.beginshowmessagebox的结果,c#,vb.net,windows-phone-7,windows-phone-8,xna,C#,Vb.net,Windows Phone 7,Windows Phone 8,Xna,目前,当我的XNA游戏启动时,当用户通过媒体播放器播放音乐时,我会弹出一个消息框。它有两个按钮,是和否。我需要做的是确定用户按下了哪个按钮,这样我就可以使用IF语句根据结果执行相关操作。目前我的代码是: Public Sub playmusic() FrameworkDispatcher.Update() If MediaPlayer.GameHasControl = False Then 'Add everything below when you w

目前,当我的XNA游戏启动时,当用户通过媒体播放器播放音乐时,我会弹出一个消息框。它有两个按钮,是和否。我需要做的是确定用户按下了哪个按钮,这样我就可以使用IF语句根据结果执行相关操作。目前我的代码是:

    Public Sub playmusic()
    FrameworkDispatcher.Update()
    If MediaPlayer.GameHasControl = False Then

        'Add everything below when you want to show the message box
        Dim MBOPTIONS As New List(Of String)()
        MBOPTIONS.Add("Yes")
        MBOPTIONS.Add("No")
        Dim result As IAsyncResult = Guide.BeginShowMessageBox("Music request", "Do you want to stop your music and play the in-game music?", MBOPTIONS, 0, MessageBoxIcon.Alert, Nothing, Nothing)

        result.AsyncWaitHandle.WaitOne()


        Dim choice As System.Nullable(Of Integer) = Guide.EndShowMessageBox(result)

        If choice.HasValue Then
            If choice.Value = 0 Then
                MediaPlayer.Stop()
                sounds = True


            Else

                sounds = False

            End If
        End If



    End If






End Sub
有人能帮我读结果需要什么代码吗