"未将对象引用设置到对象的实例",这个问题怎么解决,急呀!

mada1978 2007-04-23 12:55:00
为什么C1TrueDbgrid会有这个错误


private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(GZID));
this.panel1 = new System.Windows.Forms.Panel();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel();
this.GZAdviceIDGrid = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();
this.panel3 = new System.Windows.Forms.Panel();
this.TotalCost = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.AdviceID4 = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.AdviceID3 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.AdviceID2 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.AdviceID1 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button();
this.panel4 = new System.Windows.Forms.Panel();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.GZAdviceItemGrid = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.panel5 = new System.Windows.Forms.Panel();
this.GZAItemManageGrid = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();//这里报错,不知为什么?

白白天
this.panel6 = new System.Windows.Forms.Panel();
this.btnBatchDelte = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button5 = new System.Windows.Forms.Button();
this.textBox5 = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.button3 = new System.Windows.Forms.Button();
this.UpdateButton = new System.Windows.Forms.Button();
this.label9 = new System.Windows.Forms.Label();
....
}以上是窗口初始化的部分代码。

白天还好,晚上几个有C1TureDbgrid都出现这个问题,也就是因为这个问题我
重装了系统xp和2003.net,以及C1TrueDbgrid 控件集,但没好多久又这样了,
为什么?
...全文
4711 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
ganchunsaixx 2010-08-23
  • 打赏
  • 举报
回复
我现在也遇到这个问题咯!
mada1978 2007-04-24
  • 打赏
  • 举报
回复
只要把dbgrid去掉就行.不只c1trueDBgrid是怎么了,代码里有new()呀?
impeller 2007-04-23
  • 打赏
  • 举报
回复
断点跟踪下
ufoteam 2007-04-23
  • 打赏
  • 举报
回复
C1TrueDBGrid这个对象没有实例化
liujiwe79 2007-04-23
  • 打赏
  • 举报
回复
你里面肯定有一个对象为空了,比如你要设置button1.Enabled = false;如果button1此时为null就会报这个错误
shoushii 2007-04-23
  • 打赏
  • 举报
回复
对象没有初始化就开始使用它
Jackie 2007-04-23
  • 打赏
  • 举报
回复
对象没有初始化就开始使用它
哈哈007哈 2007-04-23
  • 打赏
  • 举报
回复
此异常说明,对象没有初始化就开始使用它,再去跟踪一下
yumanqing 2007-04-23
  • 打赏
  • 举报
回复
肯定是C1TrueDbgrid 的引用问题

110,537

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧