FindForm returns null if control resides on TabPage

  • Thread starter Thread starter korolev andrey
  • Start date Start date
K

korolev andrey

Calling FindForm of UserControl which resides on form returns instance
of this form, but when I put this control on TabPage FindForm returns
null.
How can I get Form on which my usercontrol is on?
 
How can I get Form on which my usercontrol is on?

Have you tried the TopLevelControl property? According to the docs:

"Gets the parent control that is not parented by another Windows Forms
control. Typically, this is the outermost Form that the control is
contained in."

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
Back
Top