WorkflowView.Zoom プロパティ

定義

WorkflowView のズーム レベルを取得または設定します。

public:
 property int Zoom { int get(); void set(int value); };
public int Zoom { get; set; }
member this.Zoom : int with get, set
Public Property Zoom As Integer

プロパティ値

WorkflowView のズーム レベル。

例外

ズーム レベルが AmbientTheme の最小値を下回ったとき、

- または -

ズーム レベルが AmbientTheme の最大値を上回ったとき。

ZoomWorkflowView プロパティを設定する方法を次の例に示します。

次のコード例は、MainForm.cs ファイルに含まれているワークフロー モニターの SDK サンプルの一部です。 詳細については、「 ワークフロー モニターのサンプル」を参照してください。

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

注釈

ズーム機能を使うと、WorkflowView 内のコンポーネントのサイズを拡大または縮小できます。 AmbientTheme は、WorkflowView のズーム レベルの最小値、最大値を設定するために使います。

適用対象