Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 5040 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
I've never submitted a bug report here, so I hope this is the right place and there's enough information.
On windows, calling Me.Hide() within a form fires a FormClosing event with CloseReason set to CloseReason.None
On mono (tested on 2.4 AND 2.10), the exact same code fires the FormClosing event with CloseReason set to CloseReason.UserClosing, even though the form.hide() was called in code and had nothing to do with user actions.
I'm using visualbasic code compiled on VB2008.
Private Sub cmdNext_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdNext.Click
If CurrentPage = TabControl1.TabPages.Count - 1 Then
cLog.LogEvent("Clicked Finish in Project Wizard")
Me.DialogResult = Windows.Forms.DialogResult.OK
cLog.LogEvent("Dialogresult: " & Me.DialogResult)
Me.Hide() ' Triggers FormClosing with different parameters on Win/Mono
CurrentPage = CurrentPage + 1
Private Sub frmProjectWizard_FormClosing(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If eventArgs.CloseReason = System.Windows.Forms.CloseReason.UserClosing Then
cLog.AddAction("Wizard form closed")
DialogResult = Windows.Forms.DialogResult.Cancel
Log result under Mono:
14:18:35, Running New Project Wizard
14:18:44, Clicked Finish in Project Wizard
14:18:44, Wizard form closed
-- this Last line is repeated thousands of times until a SigSegv error occurs. Note that the line 'cLog.LogEvent("Dialogresult: " & Me.DialogResult)' is never reached
Log result under Windows (Exactly the same sequence of user actions)
14:12:41, Running New Project Wizard
14:12:50, Clicked Finish in Project Wizard
14:12:50, Dialogresult: 1
14:12:50, Project wizard completed
Re-reading the report, I'm wondering whether setting DialogResult = Windows.Forms.DialogResult.OK is actually firing the FormClosing event?
This is the issue (Form.cs). Copy and paste from Mono 2.10.9, including the comment from the source code where someone else is obviously aware of the problem.
if (dialog_result != DialogResult.None && is_modal)
RaiseCloseEvents (false, false); // .Net doesn't send WM_CLOSE here.
On .Net, setting dialogresult on a model form does not trigger a close event. Dialogresult is treated like a variable on .Net, not a function.