Hello Everyone,
I am trying to create a custom textbox control and set the border color to green. I have created a new class and defined the following:
public class MyTextBox : TextBox
{
public Color m_Color;
public MyTextBox()
{
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
int borderWidth = 1;
ControlPaint.DrawBorder(e.Graphics, e.ClipRectangle, this.hitesh, borderWidth, ButtonBorderStyle.Solid, this.hitesh, borderWidth, ButtonBorderStyle.Solid, this.hitesh, borderWidth, ButtonBorderStyle.Solid, this.hitesh, borderWidth, ButtonBorderStyle.Solid);
}
After doing this, I am creating textbox control programatically on my form. However, I am not able to change the border color. If I try to create a button instead, everything works fine. Can somebody please suggest me what am I doing wrong here?
Thanking you all,
Hitesh