What gets passed to AddSubPage is an instance of whatever type you call the method with, as long as it derives from Control. If not, the compiler will throw an error. Once it has been passed, you will have to explicitly convert to the type of control actually passed.
If you do a quick test, something like this:-
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
AddServerControl("New Server Control", new ServerControl());
}
void AddServerControl(string title, Control subpage)
{
ServerControl ctrl = subpage as ServerControl;
ctrl.Talk("I am a Server control!");
}
}
class ServerControl:Control
{
public ServerControl()
{
}
public void Talk(string message)
{
MessageBox.Show(message);
}
}
you will see that the messagebox is displayed, which means that the object passed IS actually an instance of ServerControl.
Hope this helps