怎样获得媒体播放器播放结束的事件?(50分)

Z

zhjie

Unregistered / Unconfirmed
GUEST, unregistred user!
希望媒体播放器播放一段曲子结束后,显示一个提示。
请问怎样获得媒体播放器播放结束的事件?谢谢!!
 
OnNotify 事件
Notify 属性
帮助里的例子
const

ModeStr: array[TMPModes] of string = ('Not ready', 'Stopped', 'Playing', 'Recording', 'Seeking', 'Paused', 'Open');

procedure TForm1.MediaPlayer1Notify(Sender: TObject);

begin

with Sender as TMediaPlayerdo

begin

Form1.Caption := ModeStr[Mode];
{ Note we must reset the Notify property to True }
{ so that we are notified the next time the }
{ mode changes }
Notify := True;
end;

end;
 
或者在timer1的ontimer事件中,
if(MediaPlayer1.Postion=MediaPlayer1.length),呵呵
不过还是上楼的朋友方法好一些
 
多人接受答案了。
 
顶部