[Mono-winforms-list] FW: [MonoDevelop] Moving Focus Between Form

Valentin Sawadski valentin.sawadski at gmx.de
Wed Sep 19 14:56:59 EDT 2007


On Wed, 2007-09-19 at 12:36 -0500, Tri_Nguyen at Dell.com wrote:
> Thank you for your respond.  You are right that I am using
> "Form.ShowDialog".  However, I am using it in both Windows, and Linux.
> The reason I am using "Form.ShowDialog" is because I want to monitor for
> the return of the form.
> Is there a problem with "Form.ShowDialog"?

No there is no problem with ShowDialog but it blocks all other Forms of
the Application, like you already noticed.

Howerver, a workaround would be to attach a delegate to the Closed event
of the Form and then read out the DialogResult manually. (See the
Attachment for a short sample)

Kind Regards,
Valentin S.

> Thanks.
> -Tri.
> -----Original Message-----
> From: Valentin Sawadski [mailto:valentin.sawadski at gmx.de] 
> Sent: Wednesday, September 19, 2007 10:34 AM
> To: Nguyen, Tri
> Cc: mono-winforms-list at lists.ximian.com
> Subject: Re: [MonoDevelop] Moving Focus Between Form
> Hello,
> On Fri, 2007-09-14 at 12:41 -0500, Tri_Nguyen at Dell.com wrote:
> > Hi I am new to Mono, and I not sure this is a right place to ask this
> > question:
> > 
> > 1.       I am trying to port a C# Windows app to Mono running on SLES
> > 10.1.  The app starts with one form, and base on user input , it can
> > launch other forms.  When this happens, the new form gets focus, and I
> > can click on the previous form (parent?), and get focus.  On mono, the
> > app behaves differently:  I cannot get focus back to the previous,
> > unless I close the new form.
> > 
> > Any help on this matter would be appreciated.
> As far as I know there's no bug in Form.Show, so my guess is that you
> call Form.Show on Windows and changed it to Form.ShowDialog while
> porting to Linux which would explain the behavior you mentioned.
> However I you are sure that this is not the cause for the behavior, then
> please file a bug with a repro at http://bugzilla.novell.com.
> Kind Regards,
> Valentin S.
> P.S. I cc'ed this message to the winforms list, so that more people
> concerned with WinForm will notice to this issue.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Main.cs
Type: text/x-csharp
Size: 1431 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20070919/dcba6ad7/attachment.bin 

More information about the Mono-winforms-list mailing list