I use C# Windows Form to develop a program. Now, I want to draw a border on any Control which is focused, and the border has to be disappear when the control is lost focus. I try to use like below code to draw border, but I have no idea how can let the border painted before disappear.
void mButton_Paint(object sender, PaintEventArgs e)
{
ControlPaint.DrawBorder(e.Graphics, ((Control)sender).ClientRectangle, Color.DarkBlue, ButtonBorderStyle.Solid);
}
Aucun commentaire:
Enregistrer un commentaire