locked
Buttons blink. How to stop it? RRS feed

  • Question

  •  

    I've coded a WPF app and am running it on Vista. The problem is, after you click a button, it starts to slowly blink. I don't know why -- perhaps to remind the app user that it's the last button they clicked. In any case, how do I stop it from doing that? Thanks!

    Wednesday, March 12, 2008 5:11 AM

Answers

All replies

  • That's due the default style of a button with Focus. I guess you will have to create a custom style to undo that effect !!

     

    See here - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1805385&SiteID=1

     

    Wednesday, March 12, 2008 5:40 AM
  • Following your suggestion, I just switched the focus to a different button:

     

                BackButton.Focus();

     

    This worked great. Thanks much, Atul!

    - Paul

    Wednesday, March 12, 2008 5:11 PM
  • Hi,
    I got this solved :-).

     I had given a Name to my main Grid and made "Focusable="True" <Grid Name= "MainGrid" Focusable="True"> bla bla </Grid>

    Added the follwing code in my codebehind

    private void btn_Click(object sender, RoutedEventArgs e)

    {
    btnOneWay.Style = (
    Style) (FindResource("SelectedButtonStyle")); //Apply your static styles from Resource
    maingrid.Focus();
    }


    The Focus went to Grid and My button is stable :-)


    Thanks,
    Ullaskumar
    Thursday, August 21, 2008 3:37 AM
  • Simple solution: Set button's "Focusable" to False.
    • Proposed as answer by dataharald Wednesday, February 18, 2009 2:14 PM
    Wednesday, February 18, 2009 2:13 PM
  •  Thanks dataharald. That solved it for me. Have been looking on msdn for a solution for  a while. :)  
    Thursday, February 19, 2009 11:49 AM