一个BUTTON控件的IsMouseOver的问题 RRS feed

  • 问题

  • 一个用户控件代码

    public OneCodeButton()
                this.MouseEnter += (sender, e) =>
                    this.Background = MoveBackground;
                this.MouseLeave+= (sender, e) =>
                    this.Background = LeaveBackground;



    2014年12月22日 9:41


  • 你好,


    请问OneCodeButton函数你是如何调用的,如果我们在后台处理MouseEnter 和 MouseLeave事件,是可以一直处理的:

    <Button Name="btn" Height="100" Content="Button" MouseEnter="btn_MouseEnter" MouseLeave="btn_MouseLeave" />

    private void btn_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
                btn.Background = mySolidColorBrush;
    private void btn_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
                btn.Background = null;

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年12月23日 5:31