TouchToolKit for WinForms | ComponentOne
Zooming Component / C1Zoom Control Events and Examples / Zoom Detecting Manipulation String
In This Topic
    Zoom Detecting Manipulation String
    In This Topic

    C1Zoom.ManipulationStarting event occurts when the manipulation processor is first created. It means you can handle zoom or pan gesture before C1Zoom process it. For example, if you want to give priority to scrolling ListBox than scrolling the Form, use the following code.

     

    [C#]

    using C1.Win.TouchToolKit;

     

    private void c1Zoom1_ManipulationStarting(object sender,ZoomManipulationStartingEventArgs e)

    {

        if (e.TargetControl is ListBox)

        {

            e.Mode = ZoomManipulationModes.Zoom;

        }

        else

        {

             e.Mode = ZoomManipulationModes.All;

        }

    }

     

    [Visual Basic]

    Imports C1.Win.TouchToolKit

     

    Private Sub C1Zoom1_ManipulationStarting(sender As System.Object, e AsZoomManipulationStartingEventArgs) Handles C1Zoom1.ManipulationStarting

        If TypeOf e.TargetControl Is TextBox AndAlso DirectCast(e.TargetControl, TextBox).Text.Length > 0 Then

            e.Mode = ZoomManipulationModes.Zoom

        Else

            e.Mode = ZoomManipulationModes.All

        End If

    End Sub

     

    You can give priority to a TextBox than Form when the TextBox has some text.