protected override void OnMouseLeave(EventArgs e) { // "Mouse" doesn't leave if textbox is currently selected/user is typing. if (!Focused) { AnimDispatcher.AnimateMouseLeave(e, this, AnimProperties); } }
/// <summary> /// If the user loses focus of the textbox, the textbox /// colour should revert alongside the text colour to the original /// gray (or theme dependent) colour. /// </summary> protected override void OnLostFocus(EventArgs e) { // Run base. base.OnLostFocus(e); // Cancel animation. AnimDispatcher.AnimateMouseLeave(e, this, AnimProperties); }
/// <summary> /// Plays the leave animation for a specific particular row at the passed in index. /// </summary> /// <param name="leaveIndex">The index of the row for which to play the leave animation for.</param> /// <param name="lastIndex">The current selection index.</param> private void AnimateLeaveAtIndex(int leaveIndex, int lastIndex) { // Play Leave Animation for the last item. var newMessages = AnimDispatcher.AnimateMouseLeave(null, Rows[leaveIndex].DefaultCellStyle, AnimProperties, AnimationMessagesBg[leaveIndex], AnimationMessagesFg[leaveIndex], DefaultCellStyle.SelectionBackColor); // Retrieve the new message instances. AnimationMessagesBg[leaveIndex] = newMessages.Item1; AnimationMessagesFg[leaveIndex] = newMessages.Item2; // Set the index of the last item. LastIndex = lastIndex; }
protected override void OnMouseLeave(EventArgs e) { AnimDispatcher.AnimateMouseLeave(e, this, AnimProperties); }