WorkflowView.FitToWorkflowSize Method ()


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Changes the zoom level to one hundred percent to display the full size of the workflow in the WorkflowView.

Namespace:   System.Workflow.ComponentModel.Design
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)

Public Sub FitToWorkflowSize

The following example initializes the properties of a WorkflowView object be setting several properties. The FitToWorkflowSize causes the WorkflowView object to display the full size of the workflow within the ViewPortRectangle.

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
        End If
    End If
End Sub

.NET Framework
Available since 3.0
Return to top