Skip to content
Merged
Changes from all commits
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
16 changes: 16 additions & 0 deletions src/System.Windows.Forms/src/System/Windows/Forms/ToolTip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,17 @@ private void AdjustBaseFromAuto()
_delayTimes[(int)ComCtl32.TTDT.INITIAL] = _delayTimes[(int)ComCtl32.TTDT.AUTOMATIC];
}

/// <summary>
/// ScreenReader announces ToolTip text for an element
/// </summary>
private void AnnounceText(Control tool, string text)
{
tool?.AccessibilityObject?.RaiseAutomationNotification(
Automation.AutomationNotificationKind.ActionCompleted,
Automation.AutomationNotificationProcessing.All,
ToolTipTitle + " " + text);
}

private void HandleCreated(object sender, EventArgs eventargs)
{
// Reset the toplevel control when the owner's handle is recreated.
Expand Down Expand Up @@ -2068,6 +2079,11 @@ private void WmShow()
e.Cancel = true;
}

if (!e.Cancel)
{
AnnounceText(toolControl, GetCaptionForTool(toolControl));
}

// We need to re-get the rectangle of the tooltip here because
// any of the tooltip attributes/properties could have been updated
// during the popup event; in which case the size of the tooltip is
Expand Down