訪問插入到列表框中的元組的項目時遇到問題,所以我可以將它們分別插入到數據庫中。從元組列表框中訪問元組的列表框中的特定項目
要爲你看到下面的代碼更容易。
private void btnInsertToResult(object sender, EventArgs e)
{
Button butoni = sender as Button;
if (butoni.Name == "btnMonday")
{
listRezultati.Items.Add(new Tuple<string, string, string>(Monday.Name, cmbMondayFrom.Text, cmbMondayTo.Text));
}
if (butoni.Name == "btnTuesday")
{
listRezultati.Items.Add(new Tuple<string, string, string>(Tuesday.Name, cmbTuesdayFrom.Text, cmbTuesdayTo.Text));
}
if (butoni.Name == "btnWednesday")
{
listRezultati.Items.Add(new Tuple<string, string, string>(Wednesday.Name, cmbWednesdayFrom.Text, cmbWednesdayTo.Text));
}
if (butoni.Name == "btnThursday")
{
listRezultati.Items.Add(new Tuple<string, string, string>(Thursday.Name, cmbThursdayFrom.Text, cmbThursdayTo.Text));
}
if (butoni.Name == "btnFriday")
{
listRezultati.Items.Add(new Tuple<string, string, string>(Friday.Name, cmbFridayFrom.Text, cmbFridayTo.Text));
}
if (butoni.Name == "btnSaturday")
{
listRezultati.Items.Add(new Tuple<string, string, string>(Saturday.Name, cmbSaturdayFrom.Text, cmbSaturdayTo.Text));
}
}
在此先感謝。
確切的問題是什麼?你試過什麼了? –