Прочетете на английски Редактиране

Споделяне чрез


WorkflowView.Zoom Property

Definition

Gets or sets the zoom level of the WorkflowView.

C#
public int Zoom { get; set; }

Property Value

The zoom level of the WorkflowView.

Exceptions

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.

Examples

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.

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;
    }
}

Remarks

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.

Applies to

Продукт Версии
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1