hi all, i've got a problem here whereby my ctype doesn't work.

firstly, to replicate my case briefly, i've created an extension of control class
<extension()> public function getheight(byref control as Control) as integer
return control.height
end function
and i have this function that doesn't work
public sub dostuff(byref control as Control)
dim father as object
father = ctype(control.parent, Control)
father.getheight 'compiler writes: Panel class doesn't support getheight, but I've already converted it to a Control with CType!
end sub
of course if i dim father as Control it works perfectly, but in my case father may be other objects as well that aren't controls so I had to dim father as a general object, is there a fix so i could properly convert father into a Control object?