Passing Form as Control !!

  • Thread starter Thread starter Waleed Seada
  • Start date Start date
W

Waleed Seada

Hello
I would like to pass a Form as a control to a method that take a Control
as Parameter ...., is this possible, how it could be

thanks and best regards
Waleed Seada
 
Waleed said:
I would like to pass a Form as a control to a method that take a Control
as Parameter ...., is this possible, how it could be

Not sure what the question is - have you tried it? Of course it should be
possible because the Form derives from Control. The problem might be what
the method in question actually does with the Form, possibly it doesn't
expect to get one passed in - but then it should throw an exception if it
was properly written.


Oliver Sturm
 
HI all
Sorry for the unclear question !!
What I wanted to do is simply, I declare a method that takes Argument of
Control type like : InspectObject(Control C)
My question is, should this works if I call that method like this
InspectObject(this), where this is the current Form ??

Thanks and best regards
Waleed Seada
 
Waleed Seada said:
InspectObject(Control C)
My question is, should this works if I call that method
like this InspectObject(this), where this is the current
Form ??

Yes. Form inherits from Control, so all Forms are Controls.

P.
 
Thanks, I try it and it works, I know it should but there was another error
making me conflict
Thanks Guys

Waleed Seada
 
Back
Top