public static TabPage GetTabPageOfComponent (object comp)
{
Control control = comp as Control;
if (control == null)
return null;
control = control.Parent;
while (control != null) {
if (control is TabPage)
break;
control = control.Parent;
}
return control as TabPage;
}