Button border in c #

1

Good day, I have a button with flatstyle property set to flat, now what happens is that when this button is the active control of the form the edge changes in size, I would like to know if there is a way to avoid that, I am working in visual studio 2012. Project type: win-forms.

    
asked by jose marquez 09.11.2016 в 17:15
source

2 answers

1

Implement your button with EventHandler GotFocus

 this.myBoton.GotFocus += new System.EventHandler(this.myBoton_GotFocus);

When you take the focus on your button, disable it! by: myBoton.Enabled = false; :

private void myBoton_GotFocus(object sender, EventArgs e)
{
    myBoton.Enabled = false;
}

This way you will never see the shadow you see when you focus the button.

    
answered by 09.11.2016 / 18:00
source
0

It's a winform behavior when the focus gets control, the only thing that occurs to me is that in the GotFocus event of the button you change the focus to another control.

    
answered by 09.11.2016 в 21:59