我有两种形式。在2形式中,我在textbox
中添加mp3文件。关闭2表单后,我想在1表单的列表框中显示文件信息。
2表格:
private void buttonChooseSong_Click(object sender, EventArgs e)
{
OpenFileDialog openfile = new OpenFileDialog();
openfile.FileName = String.Empty;
openfile.InitialDirectory = "C:\\";
openfile.Filter = "MP3 File(*.mp3)|*.mp3";
openfile.FilterIndex = 2;
openfile.Multiselect = false;
if (openfile.ShowDialog() == DialogResult.OK)
{
song.Name = openfile.SafeFileName;
song.Path = openfile.FileName;
textBoxSongName.Text = openfile.SafeFileName;
buttonAddSong.Visible = true;
Song nsong = new Song();
}
}
private void buttonAddSong_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
如何在1表单中显示mp3
中的listbox
文件信息?