WorkflowView.FitToScreenSize 方法

定义

更改工作流设计图面的缩放级别,以便在 WorkflowView 中显示整个工作流。

public:
 void FitToScreenSize();
public void FitToScreenSize ();
member this.FitToScreenSize : unit -> unit
Public Sub FitToScreenSize ()

示例

下面的示例演示如何启用适应屏幕按钮。 此方法首先获取设计器的 IDesignerHost 接口,然后在修改 WorkflowView 属性前使用 GetService 方法检索 EnableFitToScreen 对象。 最后,调用 FitToScreenSize 方法在 WorkflowView 的可显示区域的边界之内显示整个工作流。

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

注解

实际的缩放级别取决于用户的工作流设计器的设置。

适用于

另请参阅