Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,21 @@ public LinkLabel() : base()
[SRDescription(nameof(SR.LinkLabelActiveLinkColorDescr))]
public Color ActiveLinkColor
{
get => _activeLinkColor.IsEmpty ? IEActiveLinkColor : _activeLinkColor;
get
{
if (!_activeLinkColor.IsEmpty)
{
return _activeLinkColor;
}

if (Application.IsDarkModeEnabled)
{
// Use red color for active state in dark mode (similar to IE's hover color)
return Color.FromArgb(0xFF, 0x60, 0x60);
}
Comment thread
LeafShi1 marked this conversation as resolved.
Outdated

return IEActiveLinkColor;
}
set
{
if (_activeLinkColor != value)
Expand Down Expand Up @@ -234,9 +248,26 @@ public LinkBehavior LinkBehavior
[SRDescription(nameof(SR.LinkLabelLinkColorDescr))]
public Color LinkColor
{
get => _linkColor.IsEmpty
? SystemInformation.HighContrast ? SystemColors.HotTrack : IELinkColor
: _linkColor;
get
{
if (!_linkColor.IsEmpty)
{
return _linkColor;
}

if (SystemInformation.HighContrast)
{
return SystemColors.HotTrack;
}

if (Application.IsDarkModeEnabled)
{
// Use a bright blue color that contrasts well with dark backgrounds
return Color.FromArgb(0x60, 0xA0, 0xE0);
}
Comment thread
LeafShi1 marked this conversation as resolved.
Outdated
Comment thread
LeafShi1 marked this conversation as resolved.
Outdated

return IELinkColor;
}
set
{
if (_linkColor != value)
Expand Down Expand Up @@ -346,7 +377,9 @@ public override string Text
public Color VisitedLinkColor
{
get => _visitedLinkColor.IsEmpty
? SystemInformation.HighContrast ? LinkUtilities.GetVisitedLinkColor() : IEVisitedLinkColor
? SystemInformation.HighContrast || Application.IsDarkModeEnabled
? LinkUtilities.GetVisitedLinkColor()
: IEVisitedLinkColor
: _visitedLinkColor;
set
{
Expand Down
Loading