Closed deerchao closed 1 month ago
@Olina-Zhang can your team please test this?
Yes, can repro it with .Net and .Net framework versions. Repro with NumericUpDown and DomainUpDown, but not in others: TextBox/DateTimePicker/Button
.NET 9.0/.NET8.0 and .NET Framework 4.6.2/4.8.1 have same behavior:
https://github.com/dotnet/winforms/assets/26474449/2f676385-7843-440c-bbc6-17c798a7e109
I think this is because of UpDownBase.SetToolTip
. It looks like it calls SetToolTip for its "Child" controls.
https://github.com/dotnet/winforms/blob/9014e5968c858b7375b0150a1d099716435d9f5f/src/System.Windows.Forms/src/System/Windows/Forms/Controls/UpDown/UpDownBase.cs#L975-L985
It looks like the corresponding UpDownBase.RemoveToolTip
is not implemented to cleanup. I am unsure if its a memory leak.
Verified this issue on 9.0.100-preview.6.24278.19 with dlls built from winforms repo of main branch, it was fixed: after click the clear button, tooltips removed on NumericUpDown and DomainUpDown.
https://github.com/dotnet/winforms/assets/108860782/a3f3a853-ead9-485a-b0ef-3ef8fc3c5773
Verified the issue with .NET 9.0.100-preivew6.24325.8 TP build. the issue has been fixed that have the same results as above.
.NET version
8.0.4
Did it work in .NET Framework?
No
Did it work in any of the earlier releases of .NET Core or .NET 5+?
I don't think so.
Issue description
Once tooltip set on NumericUpDown, it can't be cleared. In this sample, After click the clear button, tooltip removed on textbox but not on numericupdown.
Steps to reproduce
Create a winforms app, set tooltip to numericupdown, try to clear the tooltip, and you will see it doesn't work.
It was shocking to find out this issue exists in .net framework, too.