public Form FindForm() { Control c; c = this; while (c != null) { if (c is Form) { return (Form)c; } c = c.Parent; } return null; } [EditorBrowsable (EditorBrowsableState.Advanced)]
public static CardView FindParentCardView(Control control) { Control parent = control.Parent; while(parent != control.FindForm() && !(parent is CardView)) parent = parent.Parent; return parent as CardView; }