For Each control In Me.Controls If TypeOf control Is ShapeContainer Then For Each shape In DirectCast(control, ShapeContainer).Shapes If TypeOf shape Is RectangleShape Then Dim rect = DirectCast(shape, RectangleShape) 'Change la couleur de la bordure rect.BorderColor = Color.Blue End If Next End If Next