-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Breaking change]: DateTimePicker's Text Property #41073
Comments
@dreddy-work Do you want this documented as a breaking change? If so, the template is here: https://github.com/dotnet/docs/issues/new?assignees=gewarren&labels=breaking-change%2CPri1%2Cdoc-idea&projects=&template=breaking-change.yml&title=%5BBreaking+change%5D%3A+. |
@Tanya-Solyanik will take a look and help with the breaking changes doc. |
@merriemcgaw what's the status of this issue? |
@Tanya-Solyanik what are your thoughts? I don't recall this issue myself. |
@gewarren @merriemcgaw - we should document this as a breaking change. @Epica3055 - please use the template mentioned above. |
@gewarren - Did we answer all questions for the breaking change? |
Description
The
Text
property ofDateTimePicker
is empty beforeDateTimePicker
's handle is created.Version
Previous behavior
After
DateTimePicker
was constructed,Text
property was available. We didn't have to wait until the handle was created.New behavior
Text
property is an empty string until the handle is created, after the handle is created,Text
is set to the current date as is displayed in the control.Type of breaking change
Reason for change
This behavior was introduced as a fix for issue 9232, to match narrator (screen reader) announcement to the display text. Fixed by pr 9253
The reason why issue 9232 occurred is that we accessed
Text
byIf we hadn't set a
CustomFormat
, then there would be defaultCustomFormat
. So there would be a disparity between theText
property and the displayed text.So we changed the logic to
base.Text
is identical with native Control text. So it doesn't matter if there isCustomFormat
, theText
will be consistentwith what it looks only after the handle is created.
Recommended action
Since now if the
Handle
is not created then theText
will be a empty string. So we recommend you to accessText
in later moment like:Feature area
Windows Forms
Associated WorkItem - 263560
The text was updated successfully, but these errors were encountered: