public void Render(Graphics g) { Point strPos = new Point(20, 20); SolidBrush backgroundBrush = new SolidBrush(backgroundColor); Pen borderPen = new Pen(borderColor, borderWidth); rect.Render(g); backgroundBrush.Dispose(); borderPen.Dispose(); CleanupAfterRender(ref font); }
override public void Render(Graphics g) { if (!textSizeAndPosSet && textSet) { SetTextPositionAndSize(g, position, text); rect.Load(position, new Size((int)(textSize.Width + 0.49), (int)(textSize.Height + 0.49))); textSizeAndPosSet = true; } rect.backgroundColor = clicked ? clickedColor : ((mouseOver) ? mouseOverColor : rect.defaultBackgroundColor); rect.Render(g); DrawString(g, text, textPos); clicked = false; CleanupAfterRender(ref font); }