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