[]
Retrieves the C1ZoomCommandProvider associated with the specified IButtonControl or not.
public ZoomCommands GetZoomCommands(IButtonControl control)
Type | Name | Description |
---|---|---|
IButtonControl | control | The IButtonControl for which to retrieve the C1ZoomCommandProvider. |
Type | Description |
---|---|
ZoomCommands | ZoomCommands object, indicating the Build-in command. |
The following code example shows how to use this property.
This code example is part of a larger example provided for the C1ZoomCommandProvider class.
public class MyUserControl : UserControl
{
private GcZoomCommandProvider commands = new GcZoomCommandProvider();
private Button _zoomInButton;
private Button _zoomOutButton;
public MyUserControl()
{
InitializeComponent();
commands.Target = this;
commands.SetZoomCommands(_zoomInButton, ZoomCommands.ZoomIn);
Console.WriteLine(commands.GetZoomCommands(_zoomInButton).ToString());
commands.SetZoomCommands(_zoomOutButton, ZoomCommands.ZoomOut);
Console.WriteLine(commands.GetZoomCommands(_zoomOutButton).ToString());
}
private void InitializeComponent()
{
_zoomInButton = new Button();
_zoomInButton.Text = "+";
_zoomInButton.Size = new Size(40, 40);
_zoomInButton.Location = new Point(10, 10);
_zoomOutButton = new Button();
_zoomOutButton.Text = "_";
_zoomOutButton.Size = new Size(40, 40);
_zoomOutButton.Location = new Point(60, 10);
this.Controls.Add(_zoomInButton);
this.Controls.Add(_zoomOutButton);
}
}
Public Class MyUserControl
Inherits UserControl
Private commands As New GcZoomCommandProvider()
Private _zoomInButton As Button
Private _zoomOutButton As Button
Public Sub New()
InitializeComponent()
commands.Target = Me
commands.SetZoomCommands(_zoomInButton, ZoomCommands.ZoomIn)
Console.WriteLine(commands.GetZoomCommands(_zoomInButton).ToString())
commands.SetZoomCommands(_zoomOutButton, ZoomCommands.ZoomOut)
Console.WriteLine(commands.GetZoomCommands(_zoomOutButton).ToString())
End Sub
Private Sub InitializeComponent()
_zoomInButton = New Button()
_zoomInButton.Text = "+"
_zoomInButton.Size = New Size(40, 40)
_zoomInButton.Location = New Point(10, 10)
_zoomOutButton = New Button()
_zoomOutButton.Text = "_"
_zoomOutButton.Size = New Size(40, 40)
_zoomOutButton.Location = New Point(60, 10)
Me.Controls.Add(_zoomInButton)
Me.Controls.Add(_zoomOutButton)
End Sub
End Class