I have taken a break from WPF for about a year and I am stumped by this simple problem. I swear there was an easy way to tell a label to focus to another control when it is clicked.
<StackPanel>
<Label Target="TextBox1">Label Text</Label>
<TextBox Name="TextBox1" />
</StackPanel>
When the user clicks on “Label Text” I want the TextBox to receive focus. Is this possible?
You should make use of the Target property:
The whole point of using a Label in the first place instead of a TextBlock is to make use of its associative functionality, see the reference on MSDN.
About my note, i asked a question about how to get a real click over here, if you are curious.