SoundPlayer.SoundLocationChanged 事件

定义

设置此 SoundPlayer 路径的新音频源路径时发生。

public:
 event EventHandler ^ SoundLocationChanged;
public event EventHandler SoundLocationChanged;
member this.SoundLocationChanged : EventHandler 
Public Custom Event SoundLocationChanged As EventHandler 

事件类型

示例

下面的代码示例演示如何在附加到其他.wav文件时使用 OnSoundLocationChanged 事件处理程序接收通知 SoundPlayer 。 该代码示例是 SoundPlayer 类中的一个较大示例的一部分。

// Handler for the SoundLocationChanged event.
void player_LocationChanged( Object^ /*sender*/, EventArgs^ /*e*/ )
{
   String^ message = String::Format( "SoundLocationChanged: {0}", player->SoundLocation );
   ReportStatus( message );
}
// Handler for the SoundLocationChanged event.
private void player_LocationChanged(object sender, EventArgs e)
{   
    string message = String.Format("SoundLocationChanged: {0}", 
        player.SoundLocation);
    ReportStatus(message);
}
' Handler for the SoundLocationChanged event.
Private Sub player_LocationChanged(ByVal sender As Object, _
    ByVal e As EventArgs)
    Dim message As String = [String].Format("SoundLocationChanged: {0}", _
        player.SoundLocation)
    ReportStatus(message)
End Sub

注解

如果设置了新的 SoundPlayer 音频源路径,则会引发此事件。

有关如何处理事件的详细信息,请参阅 处理和引发事件

适用于

另请参阅