private void CreateWindow() { if (_window == null && WindowHandle != IntPtr.Zero) { lock (_windowLock) { if (_window == null && WindowHandle != IntPtr.Zero) { _lineHeight = _view.GetLineHeight(); _window = new TextViewWindow(this); _window.Paint += new PaintEventHandler(_window_Paint); _window.PaintEnd += new EventHandler(_window_PaintEnd); } } } }