public void Paint(DateTime now) { for (int i = 0; i < elements.Count; i++) { UIElement e = elements[i]; if (e == null) { continue; } e.Paint(now); if (showBorders) { Painter.DrawBox(new Rectangle(new Point(e.X1, e.Y1), new Size(e.Width - 1, e.Height - 1)), e.Visible ? Color.Green : Color.Yellow); if (e.Text == "") { e.Text = i.ToString(); } } } }