AxWindowsMediaPlayer 对象的 StringCollectionChange 事件

[与此页面关联的功能(Windows 媒体播放器 SDK)是旧版功能。 它已被 MediaPlayer 取代。 MediaPlayer 已针对Windows 10和Windows 11进行了优化。 Microsoft 强烈建议新代码尽可能使用 MediaPlayer 而不是 Windows 媒体播放器 SDK。 如果可能,Microsoft 建议重写使用旧 API 的现有代码以使用新 API。]

字符串集合发生更改时,将发生 StringCollectionChange 事件。

[C#]
private void player_StringCollectionChange(
  object sender,
  _WMPOCXEvents_StringCollectionChangeEvent e
)

[Visual Basic]
Private Sub player_StringCollectionChange(
  sender As Object,
  e As _WMPOCXEvents_StringCollectionChangeEvent
) Handles player.StringCollectionChange

事件数据

与此事件关联的处理程序的类型为 AxWMPLib._WMPOCXEvents_StringCollectionChangeEventHandler。 此处理程序接收 AxWMPLib._WMPOCXEvents_StringCollectionChangeEvent 类型的参数,其中包含与此事件相关的以下属性。

属性 说明
pdispStringCollection System.Object 更改的字符串集合项。 可以将其强制转换为 IWMPStringCollection 接口来访问它。
lCollectionIndex System.Int32 更改的字符串集合项的索引。
更改 WMPLib.WMPStringCollectionChangeEventType 指示发生的更改类型的枚举值。

要求

要求
版本
Windows 媒体播放器 9 系列或更高版本
命名空间
AxWMPLib
程序集
AxInterop.WMPLib.dll (AxInterop.WMPLib.dll.dll)

另请参阅

AxWindowsMediaPlayer 对象 (VB 和 C#)

IWMPStringCollection 接口 (VB 和 C#)

WMPStringCollectionChangeEventType