WorkflowView.FitToWorkflowSize 方法

定义

将缩放级别更改为百分之百以在 WorkflowView 中显示工作流的完整大小。

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

示例

下面的示例通过设置若干属性来初始化 WorkflowView 对象的属性。 FitToWorkflowSize 使 WorkflowView 对象在 ViewPortRectangle 中显示工作流的完整大小。

public void DisplayFullWorkflowView()
{
    IDesignerHost designerHost = designSurface.GetService(typeof(IDesignerHost)) as IDesignerHost;
    if (designerHost != null && designerHost.RootComponent != null)
    {
        WorkflowView workflowView = designerHost.RootComponent.Site.GetService(typeof(WorkflowView)) as WorkflowView;
        if (workflowView != null)
        {
            workflowView.Dock = DockStyle.Fill;
            workflowView.TabIndex = 1;
            workflowView.TabStop = true;
            workflowView.HScrollBar.TabStop = false;
            workflowView.VScrollBar.TabStop = false;
            workflowView.Focus();
            workflowView.FitToWorkflowSize();
        }
    }
}
Public Sub DisplayFullWorkflowView()
    Dim designerHost As IDesignerHost = CType(GetService(GetType(IDesignerHost)), IDesignerHost)
    If designerHost IsNot Nothing And designerHost.RootComponent IsNot Nothing Then
        Dim workflowView As WorkflowView = _
                    CType(designerHost.RootComponent.Site.GetService(GetType(WorkflowView)), WorkflowView)
        If workflowView IsNot Nothing Then
            workflowView.Dock = DockStyle.Fill
            workflowView.TabIndex = 1
            workflowView.TabStop = True
            workflowView.HScrollBar.TabStop = False
            workflowView.VScrollBar.TabStop = False
            workflowView.Focus()
            workflowView.FitToWorkflowSize()
        End If
    End If
End Sub

适用于