Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: KryptonNumericUpDown loses selection on mouse enter/leave #38

Closed
Ahmed-Abdelhameed opened this issue Dec 19, 2020 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@Ahmed-Abdelhameed
Copy link
Contributor

Ahmed-Abdelhameed commented Dec 19, 2020

Describe the bug
Whenever the mouse enters or leaves the KryptonNumericUpDown control, the selection is cleared.

To Reproduce
Steps to reproduce the behavior:

  1. Add a KryptonNumericUpDown control and type something into it.
  2. Select the text.
  3. Move the mouse cursor over and outside the control and notice the selection being cleared.

Expected behavior
The selection should remain the same when the mouse moves.

Screenshots
NUP

Desktop:

  • OS: Windows 10
  • Build: 2004.

Additional context
Looking at the source, I found out that both OnMouseEnter and OnMouseLeave methods call a private method called InvalidateChildren. That method triggers a redraw of the control (by invoking PI.RedrawWindow(...)) which causes the selection to be lost. I'm not sure if invoking RedrawWindow() is needed in OnMouseEnter or OnMouseLeave to begin with (I didn't dig deeper). If it is needed, then the selection probably needs to be maintained somehow.

While testing this, you might also notice another bug (i.e., #37) which I just reported. I was initially going to report them as one issue but decided not to because they're two separate problems.

Thank you so much for your great work :)

@Ahmed-Abdelhameed Ahmed-Abdelhameed added the bug Something isn't working label Dec 19, 2020
@Ahmed-Abdelhameed
Copy link
Contributor Author

Actually, I was wrong about the source of the bug. I'm going to close this issue and open another one with more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant