public CenteredText(string val, IWin32Window c, Font f, Size sz) { _value = val; SizeF tsz = Size.Empty; _font = f; using (DcScope s = new DcScope(c)) using (Graphics g = s.GetGraphics()) { tsz = g.MeasureString(val, f); } _offset = new Point((int)(sz.Width / 2 - tsz.Width / 2), (int)(sz.Height / 2 - tsz.Height / 2)); }