The following code example demonstrates using the ControlPaint.DrawFocusRectangle and the Handle property. To run the example paste the following code in a form. Add two buttons named Button1 and Button2 to the form and ensure all events are connected to their event handlers.
// This method draws a focus rectangle on Button2 using the // handle and client rectangle of Button2. privatevoid Button1_Click(System.Object sender, System.EventArgs e)