Skip to content

Commit 2e270eb

Browse files
JeremyKuhneLeafShi1
authored andcommitted
Retrieve color data correctly in ListView (dotnet#13062)
We accidentally dropped the call to ColorTranslator, which properly handles alpha when converting COLORREF. COLORREF's implicit conversion does this correctly. Fixes dotnet#13048
1 parent fa0dca3 commit 2e270eb

File tree

1 file changed

+2
-2
lines changed
  • src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView

1 file changed

+2
-2
lines changed

src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5992,8 +5992,8 @@ private unsafe bool WmNotify(ref Message m)
59925992
case NMCUSTOMDRAW_DRAW_STAGE.CDDS_ITEMPREPAINT:
59935993
{
59945994
using Graphics g = nmcd->hdc.CreateGraphics();
5995-
Color foreColor = Color.FromArgb((int)PInvoke.GetTextColor(nmcd->hdc).Value);
5996-
Color backColor = Color.FromArgb((int)PInvoke.GetBkColor(nmcd->hdc).Value);
5995+
Color foreColor = PInvoke.GetTextColor(nmcd->hdc);
5996+
Color backColor = PInvoke.GetBkColor(nmcd->hdc);
59975997
Font font = GetListHeaderFont();
59985998
DrawListViewColumnHeaderEventArgs e = new(
59995999
g,

0 commit comments

Comments
 (0)