问题描述
- C# 呈现控件时出错 非可视控件,不支持设置visible属性
-
我要写一个数据源控件acDataSource,是不可视控件,并添加智能标记。
在使用该控件的时候,发生了上面的错误。
下面是智能标记的代码,大神帮帮忙看看是什么问题。
同样的代码用在可视控件上没有问题,因为是从MSDN上Copy下来的class AcDataSourceDesigner : ControlDesigner { private DesignerActionListCollection actionLists; public override DesignerActionListCollection ActionLists { get { if (null == actionLists) { actionLists = new DesignerActionListCollection(); actionLists.Add(new AcDataSourceActionList(this.Component)); } return actionLists; } } } public class AcDataSourceActionList : DesignerActionList { private AcDataSource parent; public AcDataSourceActionList(IComponent component) : base(component) { this.parent = component as AcDataSource; } public override DesignerActionItemCollection GetSortedActionItems() { DesignerActionItemCollection items = new DesignerActionItemCollection(); items.Add(new DesignerActionMethodItem(this, "ConfigureDataSource", "配置数据源...", "Appearance", "配置数据源的设置.")); return items; } public void ConfigureDataSource() { Form frm = new Form(); frm.Show(); } }
时间: 2025-01-19 09:58:35