The routed direction is from child control to parent control. For example, Button1 is a child of Panel1. Both Button1 and Panel1 are attached to the C1TouchEventProvider. Button1 first receives the TouchEvents, then Panel1 receives the TouchEvents.
[C#]
using C1.Win.TouchToolKit;
private void Form1_Load(object sender, EventArgs e) { c1TouchEventProvider1.SetEnableTouchEvents(button1, true); c1TouchEventProvider1.SetEnableTouchEvents(panel1, true); c1TouchEventProvider1.Tapped += new EventHandler<TappedEventArgs>(c1TouchEventProvider1_Tapped); }
private void c1TouchEventProvider1_Tapped(object sender, TappedEventArgs e) { if (e.TargetControl != null) Console.WriteLine("{0},{1}", DateTime.Now.ToString(), e.TargetControl.Name); } |
[Visual Basic]
Imports C1.Win.TouchToolKit
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load C1TouchEventProvider1.SetEnableTouchEvents(Button1, True) C1TouchEventProvider1.SetEnableTouchEvents(Panel1, True) End Sub
Private Sub C1TouchEventProvider1_Tapped(sender As System.Object, e As TappedEventArgs) Handles C1TouchEventProvider1.Tapped If Not e.TargetControl Is Nothing Then Console.WriteLine("{0},{1}", DateTime.Now.ToString(), e.TargetControl.Name) End If End Sub |