[]
        
(Showing Draft Content)

C1.Win.TouchToolKit.C1ZoomAttachingEventArgs

C1ZoomAttachingEventArgs Class

Provides data for C1ZoomAttaching event of C1ApplicationZoom class.

Inheritance
C1ZoomAttachingEventArgs
Namespace: C1.Win.TouchToolKit
Assembly: C1.Win.C1TouchToolKit.4.8.dll
Syntax
public class C1ZoomAttachingEventArgs : EventArgs
Examples

The following code example shows how to use C1ZoomAttachingEventArgs class.

This code example is part of a larger example provided for the C1ApplicationZoom class.

public class GcApplicationZoomDemo : Form
{
	private Button _showForm2Button;
	private GcApplicationZoom _gcApplicationZoom;

	public GcApplicationZoomDemo()
	{
		InitializeComponent();

		_showForm2Button.Click += _showForm2Button_Click;
		_gcApplicationZoom.GcZoomAttaching += _gcApplicationZoom_GcZoomAttaching;
	}

	void _gcApplicationZoom_GcZoomAttaching(object sender, GcZoomAttachingEventArgs e)
	{
		// May be some forms should not be zoom.
		if (e.Form is NormalForm)
		{
			e.Cancel = true;
		}
		else
		{
			e.GcZoom.AutoShowControl = true;
		}
	}

	void _showForm2Button_Click(object sender, EventArgs e)
	{
		Form form = new NormalForm();
		form.Show();
	}

	private void InitializeComponent()
	{
		_gcApplicationZoom = new GcApplicationZoom();

		_showForm2Button = new Button();
		_showForm2Button.Text = "Click to open NormalForm";
		_showForm2Button.Location = new Point(20, 80);
		_showForm2Button.Size = new Size(200, 40);
		this.Controls.Add(_showForm2Button);
	}
}

internal class NormalForm : Form
{
	private Button _showFormButton;

	public NormalForm()
	{
		InitializeComponent();

		_showFormButton.Click += _showFormButton_Click;
	}

	void _showFormButton_Click(object sender, EventArgs e)
	{
		Form form = new NormalForm();
		form.Show();
	}

	private void InitializeComponent()
	{
		_showFormButton = new Button();
		_showFormButton.Text = "Click to open a new form";
		_showFormButton.Location = new Point(20, 20);
		_showFormButton.Size = new Size(200, 40);
		this.Controls.Add(_showFormButton);
		this.Text = "NormalForm";
	}
}
Public Class GcApplicationZoomDemo
	Inherits Form
	Private _showForm2Button As Button
	Private _gcApplicationZoom As GcApplicationZoom

	Public Sub New()
		InitializeComponent()

		AddHandler _showForm2Button.Click, AddressOf _showForm2Button_Click
		AddHandler _gcApplicationZoom.GcZoomAttaching, AddressOf _gcApplicationZoom_GcZoomAttaching
	End Sub

	Private Sub _gcApplicationZoom_GcZoomAttaching(sender As Object, e As GcZoomAttachingEventArgs)
		' May be some forms should not be zoom.
		If TypeOf e.Form Is NormalForm Then
			e.Cancel = True
		Else
			e.GcZoom.AutoShowControl = True
		End If
	End Sub

	Private Sub _showForm2Button_Click(sender As Object, e As EventArgs)
		Dim form As Form = New NormalForm()
		form.Show()
	End Sub

	Private Sub InitializeComponent()
		_gcApplicationZoom = New GcApplicationZoom()

		_showForm2Button = New Button()
		_showForm2Button.Text = "Click to open NormalForm"
		_showForm2Button.Location = New Point(20, 80)
		_showForm2Button.Size = New Size(200, 40)
		Me.Controls.Add(_showForm2Button)
	End Sub
End Class

Friend Class NormalForm
	Inherits Form
	Private _showFormButton As Button

	Public Sub New()
		InitializeComponent()

		AddHandler _showFormButton.Click, AddressOf _showFormButton_Click
	End Sub

	Private Sub _showFormButton_Click(sender As Object, e As EventArgs)
		Dim form As Form = New NormalForm()
		form.Show()
	End Sub

	Private Sub InitializeComponent()
		_showFormButton = New Button()
		_showFormButton.Text = "Click to open a new form"
		_showFormButton.Location = New Point(20, 20)
		_showFormButton.Size = New Size(200, 40)
		Me.Controls.Add(_showFormButton)
	End Sub
End Class

Constructors

Name Description
C1ZoomAttachingEventArgs(C1Zoom, Form)

Initializes a new instance of the C1ZoomAttachingEventArgs class.

Properties

Name Description
Cancel

Gets or sets a value indicating whether this C1ZoomAttaching event is cancel.

Form

Gets the Form that is preparing be attached by C1Zoom component.

GcZoom

Gets the C1Zoom component that is preparing attach to the Form.