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
[DialogResult] Add TryAgain and Continue (result 10, and 11) respectively. #4712
Comments
This comment has been minimized.
This comment has been minimized.
Alright made changes, I hope you guys do not mind if I later use As for the rest I think it should be complete, let me know about I guess that part could need documentation change so the user knows it as well too. I was thinking it's more logical to use |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thank you. I'll get the ball rolling to get an approval. In mean time if you can - open a draft PR with the change, it would aid the process. |
@RussKie |
opened #4746. |
It does not seem there are any tests for MessageBox at all except for a call I see in the TaskDialog test. |
Its used for modal forms as default value while the form is prepared/open, once you assign a value different from |
namespace System.Windows.Forms
{
public partial enum DialogResult
{
// ...
TryAgain,
Continue
}
public partial enum MessageBoxButtons
{
// ...
CancelTryContinue
}
public partial enum MessageBoxDefaultButton
{
// ...
Button4
}
} |
@terrajobst so do I convert the pr from draft now for merging or does it still have some steps left that needs done before merge? |
The API proposal has been approved, and you now have a green light to make your PR non-draft :) |
ok, converted it to a normal PR. |
@terrajobst after some testing it seems setting the default button to Button4 crashes the application when trying to display a messagebox according to what @RussKie tested. Not sure if it's just an issue with Windows however and that the crash might need to be fixed or not, it might have been an accidentally exposed field sdk headers but was never implemented. As such the proposal might need to be edited to remove Button4, unless there is a reason why it somehow crashes applications that set it. |
That's odd. Seems hard to believe that we found a bug in the SDK though. @RussKie, do we have a repro? |
@terrajobst no, false alarm. More details here #4746 (comment) |
Ah ok, I thought it was a windows bug causing it to crash, good to know now what the 4th button was for. |
How is that possible? |
This means our intellisence bundles haven't been updated yet. |
wait there is a separate bundle? |
Yes, xml-docs flow through a number of other systems and teams before becoming intellisence and docs. :) |
Is your feature request related to a problem? Please describe.
Nope, I am filing this because I noticed that the documentations here: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messagebox
As such I noticed that DialogResults of 10, and 11 are possible.
Describe the solution you'd like and alternatives you've considered
Currently I have no other alternatives in mind other than adding the 2 members to
DialogResult
.Also might need to add
MB_CANCELTRYCONTINUE
to the button options too forCancel
,Try Again
, andContinue
buttons (I can file a separate issue for this one).It also seems to miss on the default buttons to also be able to make button 4 the default if they wanted to as well (I can file a separate issue for this one as well). Nowever I would logically only make it available in .NET 6+ if approved.
Will this feature affect UI controls?
I do not think it will affect them at all, it will instead allow one to handle if one pressed the
continue
button on a dialog ortry again
to do specific things for those specific results which could be seen as an enhancement.API Changes:
As for MessageBox class this code here:
winforms/src/System.Windows.Forms/src/System/Windows/Forms/MessageBox.cs
Lines 413 to 427 in f337d18
can be replaced with:
And this could be attempted on removal:
winforms/src/System.Windows.Forms/src/System/Windows/Forms/MessageBox.cs
Lines 35 to 56 in f337d18
Edit: Shown complete changes to the enums, The changes to the
MessageBox
class that would be needed for this is a WIP.The text was updated successfully, but these errors were encountered: