hehe,我想你是要达到一下效果吧!看看
用timer控件
//显示播放或录制的时间
procedure tform1.shownowtimeorframe;
var
nowtime,alltime:LongInt;
minutes,seconds:integer;
begin
//if showformat=timeformat then
// begin
with mediaplayer1do
begin
timeformat:=tfmilliseconds;
nowtime:=position;
alltime:=length;
minutes:=nowtime div 60000;
seconds:=(nowtime-60000*minutes) div 1000;
label1.Caption:=inttostr(minutes)+'分'+inttostr(seconds)+'秒';
minutes:=alltime div 60000;
seconds:=(alltime-60000*minutes) div 1000;
label2.Caption:=inttostr(minutes)+'分'+inttostr(seconds)+'秒';
end;
end;
以前程序代码,试试看!