|
using System;
using System.Windows.Forms;
using System.Drawing;
using CustomControls.Enumerations;
namespace CustomControls.HelperClasses
{
public class EditControl:TextBox
{
public new BorderStyle BorderStyle
{
get{return BorderStyle.FixedSingle;}
}
public EditControl()
{
base.BorderStyle=BorderStyle.FixedSingle;
}
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if(m.Msg==(int)Msgs.WM_PAINT){PaintBorder();}
}
private void PaintBorder()
{
using (Graphics g=this.CreateGraphics())
{
Color borderColor =this.BackColor;
using (Pen pen= new Pen(borderColor))
{
g.DrawRectangle(pen,new Rectangle(0,0,this.Width-1, this.Height-1));
}
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.