WorkflowView.FitToWorkflowSize Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com 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
            workflowView.Focus()
            workflowView.FitToWorkflowSize()
        End If
    End If
End Sub

.NET Framework
Available since 3.0
Return to top
Show: