试图在列表框中打印歌曲刺痛。我尝试将它们添加为项目,但这只是打印 windowsform1.cs。我是否必须转换项目,或者它们是列表框打印字符串和 int 所需的功能。
private string title;
private string album, title, artist, genre;
private int length;
private void List_Click(object sender, EventArgs e)
{
MDB.listAllSongs(listBox1.Items);
}
public void listAllSongs(IList list)
{
List<Song> allSongs = new List<Song>();
foreach (Album album in albums)
{
album.listSongs(allSongs);
}
foreach (Song song in allSongs)
{
list.Add(song.ToString());
}
}
public void listSongs(List<Song> list)
{
foreach (Song song in songs)
{
list.Add(song);
}
}