Dialog closes with Cancel result, no exceptions, as if you have pressed its close button.
The only safe place to set RightToLeft property is in the form constructor.
It occured to me that this information might save somebody else's time.
If you are able to elaborate on the issue: if there is an official bug confirmation, what else might cause ShowDialog to end unexpectedly, please, do.
Re: close to tray - MSDN Forums
change Form RightToLeft property at runtime
Quote from the second link:
I have found a second bug in less than two days . This new bug is very critical .
I have Normal Form with RightToLeft property set to its default value ( RightToLeft=False) . Let us show this form with Show Function ( Form1.Show(me) )
At this Form there is a Button which change Form RightToLeft to Yes instead of No:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.RightToLeft = Windows.Forms.RightToLeft.Yes
End SubThe Form will change its Title successfully to Right Side.
Up To This there is no problem.
Problem Occure as following
If we Display this Form to the user using ShowDialog(Me) Function instead of display it using Show(Me) . Then Click Button which will change Form RightToLeft to Yes instead of No , Form will Close Suddenly with no reasons , and even not throw any exceptions .
This is the new problem & it's exist also in .NET 3.0 ( Orcase ) Too .