在form中加入checkbox和combobox,当combobox改变时:
procedure TForm2.FlatComboBox1Change(Sender: TObject);
begin
if form2.FlatCheckBox1.Checked=true then
begin
mediaplayer2.Close;
if flatcombobox1.Text='爱' then
mediaplayer2.FileName:='C:/baby/m/Love.MID';
if flatcombobox1.Text='爱相随' then
mediaplayer2.FileName:='C:/baby/m/AXS-爱相随.MID';
if flatcombobox1.Text='祝福' then
mediaplayer2.FileName:='C:/baby/m/AXS-爱相随.MID';
if flatcombobox1.Text='用心良苦' then
mediaplayer2.FileName:='C:/baby/m/YXLK-用心良苦.MID';
if flatcombobox1.Text='深爱着你' then
mediaplayer2.FileName:='C:/baby/m/SAZN-深爱着你.MID';
if flatcombobox1.Text='千纸鹤' then
mediaplayer2.FileName:='C:/baby/m/QZH-千纸鹤.MID';
if flatcombobox1.Text='爱你一万年' then
mediaplayer2.FileName:='C:/baby/m/ANYWN-爱你一万年.MID';
mediaplayer2.Open
mediaplayer2.Play;
end
else
mediaplayer2.Close;
end;