提示未创建对象实例这种普通的问题都挺好找的,但是这个我实在是不知道为什么
大家有没有遇到过自己写的程序在一些机子上运行不了的问题。
我说一下我的开发环境
Win10系统,vs2013,我生成的是.net2.0框架,其实不光是2.0,3.5,4.0,4.5还有给目标机子安装相应的.net版本都试过了都无法解决问题
而且目前出现的两个问题电脑的系统都是win7,且报错代码是同一行
1
2
3
4
5
|
private
void
cbB_JmpFreq_SelectedIndexChanged(
object
sender, EventArgs e)
{
RadioInfoDat.JmpFreq = cbB_JmpFreq.SelectedIndex;
//问题代码是这一行,就是这一行,只有这一行
}
|
我做的是一个winform程序。这个SelectedIndexChanged事件相信大家都写过,我其他控件的SelectedIndexChanged内容也是这种样子,但是报错只报错这一行。这种是为什么?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。
************** 异常文本 **************
System.NullReferenceException: 未将对象引用设置到对象的实例。
在 CPS_NoneDisplay.FormRadioInformation.cbB_JmpFreq_SelectedIndexChanged(Object sender, EventArgs e) 位置 e:\Project\MYT-390\13_SW_Resource\CCTX-618\CPS_NoneDisplay\FormRadioInformation.cs:行号 636
在 System.Windows.Forms.Control.OnMarginChanged(EventArgs e)
在 System.Windows.Forms.Control.set_Margin(Padding value)
在 System.Windows.Forms.Control.ScaleControl(SizeF factor, BoundsSpecified specified)
在 System.Windows.Forms.ComboBox.ScaleControl(SizeF factor, BoundsSpecified specified)
在 System.Windows.Forms.Control.ScaleControl(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
在 System.Windows.Forms.Control.Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
在 System.Windows.Forms.Control.ScaleChildControls(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
在 System.Windows.Forms.Control.Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
在 System.Windows.Forms.ContainerControl.OnChildLayoutResuming(Control child, Boolean performLayout)
在 System.Windows.Forms.Control.OnLayoutResuming(Boolean performLayout)
在 System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
在 CPS_NoneDisplay.FormRadioInformation.InitializeComponent() 位置 e:\Project\MYT-390\13_SW_Resource\CCTX-618\CPS_NoneDisplay\FormRadioInformation.Designer.cs:行号 214
在 CPS_NoneDisplay.FormRadioInformation..[code=csharp]
|