public HexView() { NormalFont = new Font("Courier New", 8); // Only support fixed width SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.SupportsTransparentBackColor, true); SetStyle(ControlStyles.Opaque, true); Gdi = new Win32GDIRenderer(); using (var g = CreateGraphics()) using (var LCK = Gdi.LockGraphics(g)) { _charSize = Gdi.MeasureString("A", NormalFont); // TODO make this a property so changing it updates other values. } }