WinForms equivalent of WPF's IsHitTestVisible

前端 未结 2 1310
小蘑菇
小蘑菇 2020-12-04 01:27

I have a button override that has a Label as a child. I have MouseEnter and Leave events attached to the button control.

When the mouse enters the label the button\'

2条回答
  •  一整个雨季
    2020-12-04 01:58

    The short answer is that you cannot. Both the button and the label are in fact windows, so when the mouse leave one for the other, mouseenter and mouseleave events are generated.

    The real question is, why do you need a label on a button?

提交回复
热议问题