Button is Focused RRS feed

  • Question

  • Hi

    I have a Blend window which contains 2 buttons.How an I make one button focused and the other button not focused

    I tried this:

    <Button Focusable="True" HorizontalAlignment="Left" Margin="8.917,8,0,0" VerticalAlignment="Top" Width="55.083" Height="32" Content="OK"/>
      <Button Focusable="False" HorizontalAlignment="Left" Margin="80.917,8,0,0" VerticalAlignment="Top" Width="55.083" Height="32" Content="CANCEL"/>

    But it didn't work

    In this case I want the "OK" button to be focused so its code behind is executed when the user presses "Enter"

    How can I do that by code and not in xaml because I am creating the buttons dynamically?


    Thursday, June 19, 2008 12:06 PM

All replies