Friday, December 9, 2011

WPF XAML TIP: Label with Target + Control composition == Hotkey control

Code snippet

Code Snippet
  1. <Border DockPanel.Dock="Top">
  2.     <StackPanel>
  3.         <Label
  4.             Content="_Last Name:"
  5.             Target="{Binding ElementName=lastName}" />
  6.         <TextBox x:Name="lastName" Width="100" HorizontalAlignment="Left"/>
  7.     </StackPanel>
  8. </Border>


Usage 
Press ALT+L to focus the TextBox control 'lastName'.

Result

No comments:

Post a Comment