OfType does not produce a single element but rather a collection (IEnumerable) of them.
See here[
^].
You can reproduce the
OfType
extension method in .NET 2.0 along these lines:
List<RichTextBox> widgets = new List<RichTextBox>();
foreach(Control control in this.Controls)
{
if(control is RichTextBox)
widgets.Add((RichTextBox)control);
}
}
This example is in C#, but I hope you can understand what is going on.
Regards,
Manfred