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 void 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 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();
        }
    }
}

.NET Framework
Available since 3.0
Return to top
Show: