DesignerAutoFormat.GetPreviewControl(Control) 方法

定义

返回关联的控件的副本,以便在将格式应用于控件之前提供预览。

public:
 virtual System::Web::UI::Control ^ GetPreviewControl(System::Web::UI::Control ^ runtimeControl);
public virtual System.Web.UI.Control GetPreviewControl(System.Web.UI.Control runtimeControl);
abstract member GetPreviewControl : System.Web.UI.Control -> System.Web.UI.Control
override this.GetPreviewControl : System.Web.UI.Control -> System.Web.UI.Control
Public Overridable Function GetPreviewControl (runtimeControl As Control) As Control

参数

runtimeControl
Control

Web 服务器控件的运行时版本。

返回

该方法 GetPreviewControl(Control) 返回关联的 Web 服务器控件的副本。

注解

视觉设计器(如 Visual Studio 2005)在 GetPreviewControl 对话框中使用 方法在设计时显示控件的格式化运行时预览,然后再将格式应用于实际控件。

无论对象的属性SupportsPreviewControlAttribute设置ControlDesigner如何,GetPreviewControl该方法都会返回参数中runtimeControl控件的副本。

继承者说明

在以下情况下,可以重写 GetPreviewControl(Control) 该方法:

  • 返回的控件的大小将与原始控件不同。

  • 必须用示例数据填充控件,才能提供足够的预览。

适用于

另请参阅