Skip to content

Commit 6b3cb93

Browse files
authored
fix #13861 The custom ForeColor set on PrintPreviewControl is not rendered correctly (#13863)
Fixes #13861 ## Proposed changes - [pr #12368](#12368) is to fix the High Contrast issue but omitted the case that a custom color is set. - if ForeColor is set then use that color <!-- ## Regression? - Yes / No --> ## Risk - low ## Screenshots ### Before <img width="297" height="446" alt="image" src="https://github.com/user-attachments/assets/289be94d-f8d1-46bf-8d32-acb9539b61f0" /> ### After <img width="294" height="462" alt="image" src="https://github.com/user-attachments/assets/73c20cd7-482c-48aa-9686-cc2a7825c793" /> ## Test methodology - manual
1 parent 5dcf17d commit 6b3cb93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/System.Windows.Forms/System/Windows/Forms/Printing/PrintPreviewControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ private void CalculatePageInfo()
592592

593593
private void DrawMessage(Graphics g, Rectangle rect, bool isExceptionPrinting)
594594
{
595-
Color brushColor = SystemColors.ControlText;
595+
Color brushColor = ShouldSerializeForeColor() ? ForeColor : SystemColors.ControlText;
596596
if (SystemInformation.HighContrast && Parent is Control parent)
597597
{
598598
brushColor = parent.BackColor;

0 commit comments

Comments
 (0)