TouchToolKit for WinForms | ComponentOne
Zooming Component / C1Zoom Control Events and Examples / Zoom Factor Changed
In This Topic
    Zoom Factor Changed
    In This Topic

    C1Zoom.ZoomFactorChanged event occurs when C1Zoom.ZoomFactor changed. For example, you can show current ZoomFactor on the Titlebar of the Form.

     

    [C#]

    private void c1Zoom1_ZoomFactorChanged(object sender, EventArgs e)

    {

        this.Text = string.Format("{0:P}", c1Zoom1.ZoomFactor);

    }

     

    [Visual Basic]

    Private Sub C1Zoom1_ZoomFactorChanged(sender As System.Object, e As System.EventArgs) Handles C1Zoom1.ZoomFactorChanged

        Me.Text = String.Format("{0:P}", C1Zoom1.ZoomFactor)

    End Sub

    To see how the ZoomFactorChanged event works you can look at the ZoomFactorFeatures demo in the TouchToolKit for WinForms explorer sample.

    When you select the ZoomFactorFeatures demo, the default ZoomFactor appears as 100%:

     

     

    Now, select the area on the form that you wish to zoom by pinching two fingers together and then gradually expanding your fingers apart. The following image shows the form in the preview mode before the items zoom in:

    zoom the area

     

    Release your fingers and the form appears like the following:

     

    how it looks after the zoom

     

    The log on the sample shows the changed value of the ZoomFactor property:

     

    zoom factor event for changing the zoom