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

后端 未结 12 1129
鱼传尺愫
鱼传尺愫 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条回答
  •  Happy的楠姐
    2020-11-28 09:09

    Make a custom button:

    public partial class CustomButton: Button
    {
        public ButtonPageButton()
        {
            InitializeComponent();
    
            this.SetStyle(ControlStyles.Selectable, false);
        }
    }
    

    That'll get rid of that annoying border! ;-)

提交回复
热议问题