I have a UserControl that has a text box named MyTextBox. This UserControl is placed in MainWindow.xaml, where I have the "UIElement .PreviewKeyUp "is trying to catch up.
Now while debugging, I can see the "UserControl" as the sender, not the text box.
Cheers
Cheers
You can find it as e.Source property. Try putting it on the 'text box', and if it succeeds, you can check the name property for 'myTextBox'.
[edit after comment]
If the text box is inside UserControl, you can use the OriginalSource property of the event.
No comments:
Post a Comment