dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.29k stars 957 forks source link

Implement missing `RemoveToolTip` on `UpDownBase` to cleanup `ToolTip` #11419

Closed elachlan closed 1 month ago

elachlan commented 1 month ago

Makes sure that the _upDownEdit and _upDownButtons have their tooltip removed.

Fixes #11417

I am unsure how to add tests for this. I manually tested the fix.

elachlan commented 1 month ago

@Olina-Zhang can your team please test this fix?

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 83.33333% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 74.29002%. Comparing base (0aa3a4d) to head (d2a1031). Report is 20 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #11419 +/- ## =================================================== + Coverage 74.26256% 74.29002% +0.02746% =================================================== Files 3025 3026 +1 Lines 626861 627165 +304 Branches 46742 46759 +17 =================================================== + Hits 465523 465921 +398 + Misses 157993 157897 -96 - Partials 3345 3347 +2 ``` | [Flag](https://app.codecov.io/gh/dotnet/winforms/pull/11419/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | Coverage Δ | | |---|---|---| | [Debug](https://app.codecov.io/gh/dotnet/winforms/pull/11419/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `74.29002% <83.33333%> (+0.02746%)` | :arrow_up: | | [integration](https://app.codecov.io/gh/dotnet/winforms/pull/11419/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `17.99948% <0.00000%> (+0.00354%)` | :arrow_up: | | [production](https://app.codecov.io/gh/dotnet/winforms/pull/11419/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `47.02193% <62.50000%> (+0.03602%)` | :arrow_up: | | [test](https://app.codecov.io/gh/dotnet/winforms/pull/11419/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `96.98772% <100.00000%> (+0.00087%)` | :arrow_up: | | [unit](https://app.codecov.io/gh/dotnet/winforms/pull/11419/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `43.99770% <62.50000%> (+0.03152%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet#carryforward-flags-in-the-pull-request-comment) to find out more.
Olina-Zhang commented 1 month ago

@Olina-Zhang can your team please test this fix?

Tested this PR based on the latest .NET 9.0 SDK build for GH Issue: https://github.com/dotnet/winforms/issues/11417, it is fixed with no new issue found.

Fixed

elachlan commented 1 month ago

Thank you @Olina-Zhang!!

lonitra commented 1 month ago

Looks like we have a test that checks what we set the tooltip for UpDownBase if what is expected. https://github.com/dotnet/winforms/blob/f53f153808bbbaddda3f0c1e994e8a3b5cc085a9/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/UpDownBaseTests.cs#L3015-L3035

We can use this as a base to write another test checking if setting to empty works as expected. Could you test if setting the tooltip for UpDownBase multiple times works as expected as well?

elachlan commented 1 month ago

Thanks I'll write one up and test asap.

elachlan commented 1 month ago

@lonitra I added the code to the existing test, since we would have to have the whole test replicated again anyway to set the initial tooltip text.