老兄,你要学会看帮助,哪怕英文不好也要坚持看,看多了其实很简单,就是几个术语
再加普通英语,不难的.
我将DELPHI帮助中例子加工了一下,供你参考.
var
Form1: TForm1;
TimeOver: Word;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
MediaPlayer1.DeviceType := dtCDAudio;
MediaPlayer1.Open;
MediaPlayer1.Play;
TimeOver:=0;
Timer1.Enabled := true;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if TimeOver = 10 then
begin
MediaPlayer1.Eject;
MediaPlayer1.Close;
{ disable the timer, as we are done }
Timer1.Enabled := False;
end
else
Inc(TimeOver);
end;