共用方式為


SoundPlayer.SoundLocationChanged 事件

定義

當這個 SoundPlayer 的新音效來源路徑設定後即會發生。

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

事件類型

範例

下列程式代碼範例示範當 附加至不同.wav檔案時SoundPlayer,使用 OnSoundLocationChanged 事件處理程式來接收通知。 此程式代碼範例是提供給 類別之較大範例的 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 事件。

如需如何處理事件的詳細資訊,請參閱 處理和引發事件

適用於

另請參閱