Hey, I'm trying to change the color of a textbox border say if a value returned false.

    private void UserBox_TextChanged(object sender, EventArgs e)
    {
        ControlPaint.DrawBorder(e.Graphics, this.ClientRectangle, Color.Red, ButtonBorderStyle.Solid);
    }
}

the problem is EventArgs e doesnt have a graphics member, EventArgs should be a PaintEventArgs, but when i change its paramters i get an error. perhaps im doing something in properly or dont have the correct textbox. how would i get this to work

 private void UserBox_TextChanged(object sender, EventArgs e)
        {
            Graphics UserG = UserBox.CreateGraphics();
            ControlPaint.DrawBorder(UserG, this.ClientRectangle, Color.Red, ButtonBorderStyle.Solid);
        }

Solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.