For items 1 and 2, the best way to access these input events is to create a custom TextBox obtained from the embedded TextBox. Then you can override OnKeyDown and OnMouseLeftButton. From there, you can either call the desired code, or start a new event. eg:.
public class MyTextBox : TextBox { public event MouseButtonEventHandler MySpecialMouseLeftButtonDown; protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { if (MySpecialMouseLeftButtonDown != null) { MySpecialMouseLeftButtonDown(this, e); } base.OnMouseLeftButtonDown(e); } }
Similarly with OnKeyDown.
Keithmahoney
source share