Border colour of flat button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to change the border colour of a button whos FlatStyle is set
to Flat? It's be nice to be able to change the width of the border too.

Any ideas?

Darrell
 
<style type=text/css>INPUT { BORDER-RIGHT: #ffffff 5px groove; BORDER-TOP:
#ffffff 5px groove;BORDER-LEFT: #ffffff 5px groove; BORDER-BOTTOM: #ffffff
5px groove;}
</style>
 
The border color is the same as the text color (ForeColor).

You can paint anything you want on a button, though, including a
border. The job is done inside the Paint event :

private void button1_Paint(object sender,
System.Windows.Forms.PaintEventArgs e) {

e.Graphics.DrawRectangle(Pens.Red, 0, 0, button1.Width-1,
button1.Height-1);

}

would draw a red border.
 
Back
Top