private void TUC_IndividualData_JobAssignments_SizeChanged(object sender, EventArgs e) { Control control = this.Parent; while (control as TUC_IndividualData == null) { control = control.Parent; } TUC_IndividualData myParent = control as TUC_IndividualData; if (myParent.CurrentControl == TUC_IndividualData.TDynamicLoadableUserControls.dlucJobAssignments) { FPetraUtilsObject.RefreshSpecificControlOnWindowMaxOrRestore(pnlDetailGrid); } }