1
我有以下項目的組合框:組合框中選擇項目提供了異常
1024
2048
4096
8192
我使用下面的代碼以檢索由用戶選擇的項目:
String cach = form.comboCache.SelectedItem.ToString();
,但此行是給出一個例外Null Reference Exception, Object reference not set to an instance of an object
我明白了,我所指的表單對象爲null,當我在靜態Main方法域中寫入同一行outsite時,它工作正常。感謝 – 2013-05-04 07:15:52