A follow up

  • Thread starter Thread starter web1110
  • Start date Start date
W

web1110

I need to pass the Controls ControlCollection as a parameter to a class.

I'm getting a:

The type or namespace name 'ControlCollection' could not be found (are you
missing a using directive or an assembly reference?)

error.

I tried putting in a reference to System.Windows.Forms and the appropriate
using clause.
using System.Windows.Forms;

But the error persists.

This class needs to refer back to the Controls collect in the main program.
I can use some help!

Thanx,

Bill
 
web1110,

The ControlCollection class is defined as an inner class to Control. In
order to declare the parameter, you have to declare the class it is defined
in, like so:

// Do something with the control collection.
public void DoSomething(Control.ControlCollection collection)
{
// Do stuff here.
}

Hope this helps.
 
Back
Top