You're using .Net 4 so you can use the OfType collection filter method:
For Each frm In Application.OpenForms.OfType(Of Form2)()
The type of frm loop variable is here inferred from the Of T argument, which here is Form2, so the 'As Form2' is not necessary.
Traditionally you would have to use a common type in loop, for example Form, and check the type of object using TypeOf operator, and cast the object to specific type using DirectCast/CType. I mention this because you should know and likely will encounter situations where that is needed later.
Bookmarks