i want to loop through the form control RectangleShape but they show me a ereur when i write the type of the controle ((RectangleShape))
For Each cnt As Control In Me.Controls
If TypeOf cnt Is RectangleShape Then
End If
Next
they show me this ereeur : “type ‘RectangleShape’ is not defined.”
it works as well whene i use the control type TextBox or any other controls in the VS FORM like this :
For Each cnt As Control In Me.Controls
If TypeOf cnt Is TextBox Then
End If
Next
Spell out the full type name:
Or put this at the top of your source code file
But that won’t work since RectangleShape is not a control. It is hosted by a class named ShapeContainer. You’ll need code like this:
You might want to take advantage of the designer’s ability to create a named variable for the rectangle.