WorkflowView.EnableFitToScreen 属性

定义

启用设计图面上的按钮,在单击该按钮时会更改工作流设计图面的缩放级别,以便在 WorkflowView 中显示整个工作流。

public:
 property bool EnableFitToScreen { bool get(); void set(bool value); };
public bool EnableFitToScreen { get; set; }
member this.EnableFitToScreen : bool with get, set
Public Property EnableFitToScreen As Boolean

属性值

如果已启用该动态按钮,则为 true;否则为 false

示例

下面的示例演示如何启用适应屏幕按钮。 此方法首先获取设计器的 IDesignerHost 接口,然后在修改 WorkflowView 属性前使用 GetService 方法检索 EnableFitToScreen 对象。

public void EnableFitToScreen()
{
    IDesignerHost designerHost = GetService(typeof(IDesignerHost)) as IDesignerHost;
    WorkflowView workflowView =
        designerHost.RootComponent.Site.GetService(typeof(WorkflowView)) as WorkflowView;

    if (workflowView != null)
    {
        workflowView.EnableFitToScreen = true;
        workflowView.FitToScreenSize();
    }
}
Public Sub EnableFitToScreen()

    Dim designerHost As IDesignerHost = CType(GetService(GetType(IDesignerHost)), IDesignerHost)
    Dim workflowView As WorkflowView = _
        CType(designerHost.RootComponent.Site.GetService(GetType(WorkflowView)), WorkflowView)

    If workflowView IsNot Nothing Then
        workflowView.EnableFitToScreen = True
        workflowView.FitToScreenSize()
    End If
End Sub

适用于