/// <summary> /// Locks the window so that no redrawing occurs. /// </summary> public void LockWindow() { if (miLockCount == 0) { mbSuspendPainting = true; EnhTextBoxAPIFunctions.SendMessageLong(Handle, EnhTextBoxAPIFunctions.Messages.WM_SETREDRAW, 0, 0); } ; miLockCount++; }
/// <summary> /// Unlocks and invalidates the window to resume redrawing. /// </summary> public void UnlockWindow() { miLockCount--; if (miLockCount == 0) { mbSuspendPainting = false; EnhTextBoxAPIFunctions.SendMessageLong(Handle, EnhTextBoxAPIFunctions.Messages.WM_SETREDRAW, 1, 0); Invalidate(); } if (miLockCount < 0) { miLockCount = 0; } }
/// <summary> /// Sets the selection start and length. /// </summary> /// <param name="start">The start of the selection.</param> /// <param name="length">The length of the selection.</param> public void SetSel(int start, int length) { EnhTextBoxAPIFunctions.SendMessageLong(Handle, EnhTextBoxAPIFunctions.Messages.EM_SETSEL, start, start + length); }