WorkflowView.Zoom 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定 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 的縮放層級。
例外狀況
範例
下列範例將示範如何設定 的 屬性。
這個程式碼範例是 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 的最小與最大縮放層級。