Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
WorkflowView Class
 Zoom Property

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
WorkflowView..::.Zoom Property

Gets or sets the zoom level of the WorkflowView.

Namespace:  System.Workflow.ComponentModel.Design
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)
Visual Basic (Declaration)
Public Property Zoom As Integer
Visual Basic (Usage)
Dim instance As WorkflowView
Dim value As Integer

value = instance.Zoom

instance.Zoom = value
C#
public int Zoom { get; set; }
Visual C++
public:
property int Zoom {
    int get ();
    void set (int value);
}
JScript
public function get Zoom () : int
public function set Zoom (value : int)

Property Value

Type: System..::.Int32
The zoom level of the WorkflowView.
ExceptionCondition
NotSupportedException

If the zoom level is less than the minimum zoom level of the AmbientTheme

-or-

if the zoom level exceeds the maximum zoom level of the AmbientTheme.

Use the zoom feature to enlarge or reduce the size of the components inside the WorkflowView. The AmbientTheme sets the minimum and maximum zoom levels for the WorkflowView.

The following example shows how to set the Zoom property of a WorkflowView.

This code example is part of the Workflow Monitor SDK Sample from the MainForm.cs file. For more information, see Workflow Monitor Sample.

Visual Basic
Private Sub ToolStripComboBoxZoom_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles toolStripComboBoxZoom.SelectedIndexChanged
    If workflowViewHost.WorkflowView Is Nothing Then
        Return
    End If

    'Parse the value and set the WorkflowView zoom - set to 100% if invalid
    Dim NewZoom As String = Me.toolStripComboBoxZoom.Text.Trim()
    If NewZoom.EndsWith("%") Then
        NewZoom = NewZoom.Substring(0, NewZoom.Length - 1)
    End If

    If NewZoom.Length > 0 Then
        Try
            Me.workflowViewHost.WorkflowView.Zoom = Convert.ToInt32(NewZoom)
        Catch
            Me.workflowViewHost.WorkflowView.Zoom = 100
        End Try
    Else
        Me.workflowViewHost.WorkflowView.Zoom = 100
    End If
End Sub

C#
private void ToolStripComboBoxZoom_SelectedIndexChanged(object sender, EventArgs e)
{
    if (workflowViewHost.WorkflowView == null) return;
    //Parse the value and set the WorkflowView zoom - set to 100% if invalid
    string newZoom = this.toolStripComboBoxZoom.Text.Trim();
    if (newZoom.EndsWith("%"))
        newZoom = newZoom.Substring(0, newZoom.Length - 1);

    if (newZoom.Length > 0)
    {
        try
        {
            this.workflowViewHost.WorkflowView.Zoom = Convert.ToInt32(newZoom);
        }
        catch
        {
            this.workflowViewHost.WorkflowView.Zoom = 100;
        }
    }
    else
        this.workflowViewHost.WorkflowView.Zoom = 100;
}

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker