Resolved Draw focus rectangle on Label

Makavelli

Member
Joined
Apr 25, 2005
Messages
10
Programming Experience
1-3
Hi,

I have a user control with some labels and some corresponding controls. I will like for the label to be highlighted when one of its control gets the focus but I don't know how to do it.

I really want it to look like the focus rectangle effect on the checkbox control's label.
highlight.png


Does anyone know how to do this?

Thanks.
 
Last edited:
Found the solution on another forum

Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim r As Rectangle = RadioButton1.ClientRectangle
r.Inflate(5, 5)
e.Graphics.DrawRectangle(New Pen(Color.Green, 1), r)
End Sub
 
Back
Top