ControlDesigner.CanBeParentedTo(IDesigner) 方法

定义

指示指定设计器的控件是否可以成为此设计器控件的父级。Indicates if this designer's control can be parented by the control of the specified designer.

public:
 virtual bool CanBeParentedTo(System::ComponentModel::Design::IDesigner ^ parentDesigner);
public virtual bool CanBeParentedTo (System.ComponentModel.Design.IDesigner parentDesigner);
abstract member CanBeParentedTo : System.ComponentModel.Design.IDesigner -> bool
override this.CanBeParentedTo : System.ComponentModel.Design.IDesigner -> bool
Public Overridable Function CanBeParentedTo (parentDesigner As IDesigner) As Boolean

参数

parentDesigner
IDesigner

IDesigner,它可管理要检查的控件。The IDesigner that manages the control to check.

返回

如果由指定设计器管理的控件可以成为由此设计器管理的控件的父级,则为 true;否则为 falsetrue if the control managed by the specified designer can parent the control managed by this designer; otherwise, false.

注解

此方法可用于测试控件是否可以是特定类型的父级的父级。This method is useful for testing whether a control can be parented by a particular type of parent. 例如,TabPage 控件只能成为 TabControl 控件的父级。For example, TabPage controls can only be parented by TabControl controls.

备注

将项从工具箱拖到设计图面上时,不会调用此方法。This method is not called when an item is dragged from the Toolbox onto the design surface.

适用于