Closed Liv-Goh closed 2 months ago
@LeafShi1 could you do an initial investigation to see what regressed here?
Scratch project repro:
private readonly LinkLabel _linkLabel1;
public Form1()
{
InitializeComponent();
Bitmap bitmap = new Bitmap(100, 100);
using (Graphics g = Graphics.FromImage(bitmap))
{
g.Clear(Color.Red);
}
_linkLabel1 = new()
{
Font = new Font("Segoe UI", 48F, FontStyle.Regular, GraphicsUnit.Point, 0),
Image = bitmap,
Size = new Size(322, 86),
Text = "linkLabel1"
};
Controls.Add(_linkLabel1);
PerformLayout();
}
Here is the regex I used to find the other mistaken using:
^\s*using\s[^\(].*;.$\s*{
Verified this issue in the latest .NET 9.0 Preview 7 SDK build: 9.0.100-preview.7.24372.11, it was fixed: the image for LinkLabel display and refresh correctly in designer and runtime:
Verified the issue with .NET 9.0.100-preview7.24407.12 test pass build that the issue has been fixed, which have the same results as above.
.NET version
.NET 9.0 SDK build: 9.0.100-preview.6.24328.19
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes, this is a regression issue. Not reproduce on .NET 8.0
Issue description
Current Behavior (.NET 9.0):
Expected Behavior (.NET 8.0):
Steps to reproduce
More Info linkLabel ImageList property have the similar behavior