Last active
November 8, 2016 11:44
-
-
Save NoobInTraining/969b8bc41b9f823e5d626be4a3ba7a4c to your computer and use it in GitHub Desktop.
A Custom Label to Draw a Bordfer around a albel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class CustomLabel : Label | |
{ | |
protected override void OnPaint(PaintEventArgs e) | |
{ | |
base.OnPaint(e); | |
Color borderColour = Color.Black; | |
int borderThickness = 1; | |
ControlPaint.DrawBorder(e.Graphics, ClientRectangle, | |
borderColour, borderThickness, ButtonBorderStyle.Solid, | |
borderColour, borderThickness, ButtonBorderStyle.Solid, | |
borderColour, borderThickness, ButtonBorderStyle.Solid, | |
borderColour, borderThickness, ButtonBorderStyle.Solid); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment