[]
Represents the component which can be enables you to group collections of controls and made these controls can be zoom by two finger touch.
[ToolboxBitmap(typeof(C1ZoomPanel), "C1ZoomPanel.png")]
public class C1ZoomPanel : Panel, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable
When the C1ZoomPanel loaded, C1ZoomPanel will change all GcZoomPanel's children control to a inner panel. In run time, you should use GcZoomPanel.InnerControls property instead of GcZoomPanel.Controls
You can't use C1Zoom and C1ZoomPanel together.
C1ZoomPanel can't be a child of another C1ZoomPanel.
The C1ZoomPanel can't change the tooltip, contextMenu, common dialog's font and size.
The following code example shows how to use C1ZoomPanel component.
You can copy the code to a exsit Windows Forms appliction. And set the form in the sample code as start form.
If you find a licenses error when run this code. Try to drag a C1ZoomPanel component to a any Form from tool box can generate the licenses information to this project.
public class GcZoomPanelDemo : Form
{
private TextBox _childTextBox;
private Button _childButton;
private GcZoomPanel _gcZoomPanel;
public GcZoomPanelDemo()
{
InitializeComponent();
// Set the max zoom factor is 4.0
_gcZoomPanel.MaxZoomFactor = 4f;
// Set feedback area color
_gcZoomPanel.FeedbackAreaBackColor = SystemColors.ControlDark;
// If feedback area want to use image, you showld use FeedbackAreaBackgroundImage and
// FeedbackAreaBackgroundImageLayout property.
//_gcZoomPanel.FeedbackAreaBackgroundImage = Image.FromFile(@"c:\image.jpg");
//_gcZoomPanel.FeedbackAreaBackgroundImageLayout = ImageLayout.Stretch;
}
private void InitializeComponent()
{
_childTextBox = new TextBox();
_childTextBox.Text = "This is TextBox";
_childTextBox.Location = new Point(225, 150);
_childTextBox.Size = new Size(150, 25);
_childButton = new Button();
_childButton.Text = "This is Button";
_childButton.Location = new Point(225, 200);
_childButton.Size = new Size(150, 25);
_gcZoomPanel = new GcZoomPanel();
_gcZoomPanel.Location = new Point(100, 100);
_gcZoomPanel.Size = new Size(600, 400);
_gcZoomPanel.BackColor = SystemColors.ControlDarkDark;
_gcZoomPanel.Controls.Add(_childTextBox);
_gcZoomPanel.Controls.Add(_childButton);
this.Controls.Add(_gcZoomPanel);
}
}
Public Class GcZoomPanelDemo
Inherits Form
Private _childTextBox As TextBox
Private _childButton As Button
Private _gcZoomPanel As GcZoomPanel
Public Sub New()
InitializeComponent()
' Set the max zoom factor is 4.0
_gcZoomPanel.MaxZoomFactor = 4.0F
' Set feedback area color
_gcZoomPanel.FeedbackAreaBackColor = SystemColors.ControlDark
' If feedback area want to use image, you showld use FeedbackAreaBackgroundImage and
' FeedbackAreaBackgroundImageLayout property.
'_gcZoomPanel.FeedbackAreaBackgroundImage = Image.FromFile(@"c:\image.jpg");
'_gcZoomPanel.FeedbackAreaBackgroundImageLayout = ImageLayout.Stretch;
End Sub
Private Sub InitializeComponent()
_childTextBox = New TextBox()
_childTextBox.Text = "This is TextBox"
_childTextBox.Location = New Point(225, 150)
_childTextBox.Size = New Size(150, 25)
_childButton = New Button()
_childButton.Text = "This is Button"
_childButton.Location = New Point(225, 200)
_childButton.Size = New Size(150, 25)
_gcZoomPanel = New GcZoomPanel()
_gcZoomPanel.Location = New Point(100, 100)
_gcZoomPanel.Size = New Size(600, 400)
_gcZoomPanel.BackColor = SystemColors.ControlDarkDark
_gcZoomPanel.Controls.Add(_childTextBox)
_gcZoomPanel.Controls.Add(_childButton)
Me.Controls.Add(_gcZoomPanel)
End Sub
End Class
Name | Description |
---|---|
C1ZoomPanel() | Initializes a new instance of the C1ZoomPanel class. |
Name | Description |
---|---|
AllowDoubleTapZoom | Gets or sets a value indicating whether allow double tap to zoom. ZoomFactor will change to 2f or MaxZoomFactor if it is less than 2f before double tap; otherwise, it will change to 1f. |
AllowMouseWheelScroll | Gets or sets which types of MouseWheel scroll are possible. |
AllowMouseWheelZoom | Gets or sets a value indicating whether allow zoom by control + mouse wheel. |
AllowPanScroll | Gets or sets a value indicating whether allow scroll the panel by pan gesture. |
AllowPinchZoom | Gets or sets a value indicating whether the panel can perform gesture zoom. |
AlternativeContentSettings | Gets the settings indicating how to display zoom factor when gesture zooming. |
AutoShowControl | Gets or sets a value that indicates whether the control auto show when get focus or touch keyboard popup. |
BoundaryFeedbackMode | Gets or sets a value indicating how to show visual feedback when scroll reach end point. |
DefaultZoomPolicies | Gets the default zoom policies. |
FeedbackAreaBackColor | Gets or sets the background color of blank areas in panel when to zoom and scroll. |
FeedbackAreaBackgroundImage | Gets or sets the background image displayed in the blank areas of panel when to zoom and scroll. |
FeedbackAreaBackgroundImageLayout | Gets or sets the background image layout as defined in the ImageLayout enumeration. |
InnerControls | Gets the child controls of the panel. |
InnerPanel | Gets the inner panel that contains the target form's child controls. |
InnerPanelLayoutMode | Gets or sets the layout mode of InnerPanel. |
IsHorizontalRailEnabled | Gets or sets a value that indicates whether the scroll rail is enabled for the horizontal axis. |
IsVerticalRailEnabled | Gets or sets a value that indicates whether the scroll rail is enabled for the vertical axis. |
MaxZoomFactor | Gets or sets the maximum zoom factor of the panel. |
ScrollIndicatorMode | Gets or sets a value indicating which mode to indicate current scroll location. |
ScrollLocation | Gets or sets the scroll location of the panel. |
Site | |
ZoomFactor | Gets or sets the zoom factor of the panel. |
ZoomPolicies | Gets the custom zoom policies. C1Zoom will look for zoom policies in this list. |
ZoomPreviewMode | Gets or sets a value indicating how to preview the panel when gesture zooming. |
ZoomSnapDistance | Gets or sets a value indicate the minimum distance that can cause current zoom factor snap to a zoom factor in ZoomSnapPoints. |
ZoomSnapPoints | Gets a group of zoom factor, when zoom ending, the result zoom factor will try to snap to a zoom factor in this group. |
ZoomTargets | Gets the collection of controls that can receive the zoom gesture message. |
Name | Description |
---|---|
AnimationCompleted | Occurs when animation is completed. |
AnimationStarting | Occurs before C1ZoomPanel start animation. |
ControlAutoShowing | Occurs before C1ZoomPanel start show the target control. |
ControlBoundsZooming | Occurs before C1ZoomPanel start zoom the target control's bounds. |
ControlFontZooming | Occurs before C1ZoomPanel start zoom the target control's font. |
ManipulationStarting | Occurs when the manipulation processor is first created. |
ZoomFactorChanged | Occurs when ZoomFactor changed. |