终于解决了,把答案送给大家参考
我上边写的是:
int x =int.Parse(comboBox1.SelectedIndex.ToString()); //SelectedIndex返回列表中第几项。即显示年份在组合框中的序号
正确的是:
int x = int.Parse(comboBox1.SelectedItem.ToString()); //SelectedItem返回项本身字符串值,即显示年份的日期
我上边写的是:
int x =int.Parse(comboBox1.SelectedIndex.ToString()); //SelectedIndex返回列表中第几项。即显示年份在组合框中的序号
正确的是:
int x = int.Parse(comboBox1.SelectedItem.ToString()); //SelectedItem返回项本身字符串值,即显示年份的日期
