的sooo,我不斷收到錯誤:無法在ComboBox.SelectedItem訪問屬性
'object' does not contain a definition for 'text' and no extension method 'text' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
爲以下代碼 - 誰能告訴我爲什麼?
private void cboDataSets_SelectedIndexChanged(object sender, EventArgs e)
{
int cats = Int16.Parse(cboDataSets.SelectedItem.text);
lblGenerateSelection.Text = ("you have selected " + (20 - cats) + "cats you'd like to adopt");
}
非常感謝你讓埃裏克J – user1556084 2012-07-26 22:02:00
很高興提供幫助。歡迎來到Stack Overflow。請記住接受解決您問題的答案。 – 2012-07-26 22:54:09