首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

Winform引用DEV控件有关问题

2013-03-06 
Winform引用DEV控件问题声明 private UTextEdit txtNameUTextEdit是用户控件继承自DevExpress.XtraEditor

Winform引用DEV控件问题
声明 private UTextEdit txtName;  UTextEdit是用户控件继承自DevExpress.XtraEditors.TextEdit,dev版本8.3


this.txtName = new UTextEdit();
this.txtName.Properties.BeginInit();
this.txtName.Properties.AppearanceDisabled.BackColor = SystemColors.Control;
this.txtName.Properties.AppearanceDisabled.ForeColor = Color.FromArgb(64, 64, 64);
this.txtName.Properties.AppearanceDisabled.Options.UseBackColor = true;
this.txtName.Properties.AppearanceDisabled.Options.UseForeColor = true;
this.txtName.Properties.BorderStyle = BorderStyles.Office2003;

在查看页面内的时候总是报“未将对象引用设置到对象的实例”,把带有Properties属性的行注释了就不会报错,什么原因,怎么解决类似这样的错误,有遇到的或有知道的说一下,3Q  分不多,见谅! Winform引用DEV控件问题 properties
[解决办法]
this.txtName.Properties是null
看看为什么null吧
[解决办法]
看一下你的UTextEdit的定义
这一大段是用户控件拖到设计器中在Designer文件中自动生成的?还是你代码中自己加的?
[解决办法]
引用:
引用:this.txtName.Properties是null
看看为什么null吧
我要知道为什么是null我就不问了


那你看看别的构造函数吧。或者自己设上个Properties
不是没有关系。很可能有很大的关系。

热点排行