/// <summary> /// constructor /// </summary> public ChControl() { children = new ChControlCollection(); forecolor = Color.Black; backcolor = Color.Transparent; Font = new Font("Microsoft Sans Serif", 8.25f); }
/// <summary> /// Recursivly search through all children and add eventhandlers for PrePaint and PostPaint /// </summary> /// <param name="controls"></param> private void RecursiveSearch(ChControlCollection controls) { foreach (ChControl cc in controls) { cc.PrePaint += new PaintHandler(cc_PrePaint); cc.PostPaint += new PaintHandler(cc_PostPaint); if (cc.Children.Count > 0) { RecursiveSearch(cc.Children); } } }