Delphi程序设计教程—动画与多媒体程序设计
代码编辑//媒体控制面板鼠标单击事件procedure TForm1.MediaPlayer1Click(Sender: TObject; Button: TMPBtnType; var DoDefault: Boolean); var total,HH,MM,SS:integer; begin //根据选择的按钮来处理case Button of btPlay: begin TrackBar1.Max := MediaPlayer1.Length;//设置轨迹条的最大长度total:= MediaPlayer1.Length div 1000;//总时间秒数HH:=total div 3600; //提取小时MM:=(total mod 3600) div 60;//提取分钟SS:=total mod 60; //提取秒label2.Caption:='总时间:'+FormatFloat('00',HH)+'小时' +FormatFloat('00',MM)+'分钟' +FormatFloat('00',SS)+'秒'; end;
1.77MB
文件大小:
评论区