如何在數據綁定模式下按降序對ListBox進行排序?如何在數據綁定模式下按降序對ListBox進行排序?
我舉一個例子:
System.Drawing.Printing.PrintDocument printDoc = new System.Drawing.Printing.PrintDocument();
ArrayList paperSizes = new ArrayList();
for (int i = 0; i < printDoc.PrinterSettings.PaperSizes.Count; i++)
{
paperSizes.Add(printDoc.PrinterSettings.PaperSizes[i]);
}
listBox1.DataSource = paperSizes;
listBox1.DisplayMember = "PaperName";
listBox1.ValueMember = "Kind";
引發錯誤「設置數據源屬性時無法修改Items集合。」 – qtg