프로그램 자료/Visual C#

해당 콘트롤에 border를 주고 싶을 때

motolies 2016. 11. 21. 09:40

출처 : 기억이 안난다... ㅠㅠ



/// <summary>

/// border 생성

/// </summary>

/// <param name="e"></param>

protected override void OnPaint(PaintEventArgs e)

{

    base.OnPaint(e);

    int borderWidth = 1;

    Color borderColor = Color.FromArgb(int.Parse("FFBBBBBB", NumberStyles.HexNumber));

 

    ControlPaint.DrawBorder(e.Graphics, e.ClipRectangle, borderColor,

        borderWidth, ButtonBorderStyle.Solid, borderColor, borderWidth,

    ButtonBorderStyle.Solid, borderColor, borderWidth,

        ButtonBorderStyle.Solid,

    borderColor, borderWidth, ButtonBorderStyle.Solid);

}