//
// textEdit1
//
this.textEdit1.Location = new System.Drawing.Point(4, 20);
this.textEdit1.Name = "textEdit1";
this.textEdit1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.HotFlat;
this.textEdit1.Properties.MaxLength = 15;
this.textEdit1.Properties.NullValuePrompt = "<Beta Code>";
this.textEdit1.Properties.NullValuePromptShowForEmptyValue = true;
this.textEdit1.Properties.PasswordChar = '*';
this.textEdit1.Size = new System.Drawing.Size(250, 22);
this.textEdit1.TabIndex = 2;
由于此原因,我收到5条警告消息和一个调用堆栈错误,这意味着我无法在设计器模式下查看它。
警告信息:
Warning 1 Object reference not set to an instance of an object.
Warning 2 Object reference not set to an instance of an object.
Warning 3 Object reference not set to an instance of an object.
Warning 4 Object reference not set to an instance of an object.
Warning 5 Object reference not set to an instance of an object.
任何帮助他都会赞赏。提前谢谢。
调用堆栈:
at DevExpress.XtraEditors.Repository.RepositoryItem.CreateDesigner()
at DevExpress.XtraEditors.Repository.RepositoryItem.FilterProperties(PropertyDescriptorCollection collection)
at DevExpress.XtraEditors.Repository.RepositoryItem.System.ComponentModel.ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
at System.ComponentModel.TypeDescriptor.MergedTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetProperties(Attribute[] attributes)
at System.ComponentModel.TypeDescriptor.GetPropertiesImpl(Object component, Attribute[] attributes, Boolean noCustomTypeDesc, Boolean noAttributes)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetPropertiesHelper(IDesignerSerializationManager manager, Object instance, Attribute[] attributes)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)
答案 0 :(得分:0)
您根本忘记用数据提供一个对象。确保所有需要数据的源和对象都能获得它。
首先省略一些代码,使用try和catch查看错误源自哪里,如果你可以通过检查调用堆栈来做到这一点。
答案 1 :(得分:0)
我怀疑TextEdit.Properties对象没有根据生成的警告数量进行实例化(对5个Properties属性的引用有5个警告)。快速谷歌搜索显示其他一些人在使用DevExpress控件时遇到此问题,但我找不到任何解决方案。
以下是您应该尝试的一些事项: