Skip to content

Commit acb2d59

Browse files
committed
Add NotifyWinEvent in MonthCalendar
1 parent 728b2c6 commit acb2d59

File tree

1 file changed

+13
-3
lines changed
  • src/System.Windows.Forms/System/Windows/Forms/Controls/MonthCalendar

1 file changed

+13
-3
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,9 +2063,9 @@ private unsafe void WmDateChanged(ref Message m)
20632063
_selectionStart = start;
20642064
_selectionEnd = end;
20652065

2066-
AccessibilityNotifyClients(AccessibleEvents.Focus, -1);
2067-
AccessibilityNotifyClients(AccessibleEvents.NameChange, -1);
2068-
AccessibilityNotifyClients(AccessibleEvents.ValueChange, -1);
2066+
NotifyWinEvent(AccessibleEvents.Focus);
2067+
NotifyWinEvent(AccessibleEvents.NameChange);
2068+
NotifyWinEvent(AccessibleEvents.ValueChange);
20692069

20702070
// We should use the Date for comparison in this case. The user can work in the calendar only with dates,
20712071
// while the minimum / maximum date can contain the date and custom time, which, when comparing Ticks,
@@ -2095,6 +2095,16 @@ private unsafe void WmDateChanged(ref Message m)
20952095
OnDateChanged(new DateRangeEventArgs(start, end));
20962096
}
20972097

2098+
private void NotifyWinEvent(AccessibleEvents accessibleEvent)
2099+
{
2100+
PInvoke.NotifyWinEvent(
2101+
(uint)accessibleEvent,
2102+
this,
2103+
(int)OBJECT_IDENTIFIER.OBJID_CLIENT,
2104+
(int)PInvoke.CHILDID_SELF
2105+
);
2106+
}
2107+
20982108
/// <summary>
20992109
/// Handles the MCN_GETDAYSTATE notification by returning an array of bitmasks, one entry per month,
21002110
/// that specifies which dates to display in bold.

0 commit comments

Comments
 (0)