I'm new to Visual Basic and I want to change the border color of a Button, but I don't see any option to do that in the IDE (Visual Studio 2017). Is there a way to do this?
The way to do this is not very obvious as the default Button doesn't allow for a coloured border.
First you have to set the Button's FlatStyle property to FlatStyle.Flat. Then you have to set the Button's FlatAppearance.BorderColor property to the colour of your choice.
You can do both of those things in the Visual Studio form designer if you want, or you can do it in code like this:
Button1.Flatstyle = FlatStyle.Flat
Button1.FlatAppearance.BorderColor = Color.Yellow
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With