How to set/change/remove focus style on a Button in C#?

后端 未结 12 1114
鱼传尺愫
鱼传尺愫 2020-11-28 08:39

I have a couple of buttons of which I modified how they look. I have set them as flat buttons with a background and a custom border so they look all pretty and nothing like

12条回答
  •  一生所求
    2020-11-28 09:29

    Is this the effect you are looking for?

    public class NoFocusCueButton : Button
    {
        protected override bool ShowFocusCues
        {
            get
            {
                return false;
            }
        }
    }
    

    You can use this custom button class just like a regular button, but it won't give you an extra rectangle on focus.

提交回复
热议问题