[Mono-winforms-list] MessageBox

Ravindra Kumar rkumar@novell.com
Sun, 24 Oct 2004 23:22:21 -0600


Hey guys,
There is some unfinished code in Form and X11 driver that
is causing this. We are working on it. The problem will get
solved once we are finished with the relevant changes.

Sorry for the inconvenience.

- Ravi

>>> Dasnois Benjamin <benjamin.dasnois@gmail.com> 10/24/04 2:49 PM >>>
Hi,
I just did a quick test and it appeared that this is not a MessageBox
problem. The problem certainly is in Form because any Form you try to
ShowDialog will just throw the same exception... A test is attached.


On Sun, 24 Oct 2004 01:12:00 +0100, Paul <paul@all-the-johnsons.co.uk>
wrote:
> Hi,
> 
> I'm trying to get the following code to work. It will compile, but
when
> I run it, I get the following error
> 
> Unhandled Exception: System.InvalidOperationException: Already
visible
> forms cannot be displayed as a modal dialog. Set the Visible property
to
> 'false' prior to calling Form.ShowDialog.
> in <0x0008d> System.Windows.Forms.Form:ShowDialog
> (System.Windows.Forms.IWin32Window)
> in <0x00058> (wrapper remoting-invoke-with-check)
> System.Windows.Forms.Form:ShowDialog
(System.Windows.Forms.IWin32Window)
> in <0x00012> System.Windows.Forms.Form:ShowDialog ()
> in <0x0004b> (wrapper remoting-invoke-with-check)
> System.Windows.Forms.Form:ShowDialog ()
> in <0x00038> MessageBoxForm:RunDialog ()
> in <0x0004b> (wrapper remoting-invoke-with-check)
> MessageBoxForm:RunDialog ()
> in <0x00040> System.Windows.Forms.MessageBox:Show (string,string)
> in <0x00142> PointTest.PointTest:Main (string[])
> 
> The code is this
> 
> using System;
> using System.Windows.Forms
> 
> namespace PointTest
> {
>   public class Point
>   {
>      private int x, y;
>      public Point()
>      {
>      }
>      public Point( int xValue, int yValue )
>      {
>         X = xValue;
>         Y = yValue;
>      }
>      public int X
>      {
>         get
>         {
>            return x;
>         }
>         set
>         {
>            x = value; // no need for validation
>         }
>      }
>      public int Y
>      {
>         get
>         {
>            return y;
>         }
>         set
>         {
>            y = value; // no need for validation
>         }
>      }
>      public override string ToString()
>      {
>         return "[" + x + ", " + y + "]";
>      }
>   }
> 
>   class PointTest
>   {
>      static void Main( string[] args )
>      {
>         Point point = new Point( 72, 115 );
>         string output = "X coordinate is " + point.X +
>            "\n" + "Y coordinate is " + point.Y;
>         point.X = 10; // set x-coordinate via X property
>         point.Y = 10; // set y-coordinate via Y property
>         output += "\n\nThe new location of point is " + point;
>         MessageBox.Show( output, "Demonstrating Class Point" );
>      }
>   }
> }
> 
> mcs PointTest.cs -r:System.Windows.Forms
> 
> Is this a problem with MessageBox or something else?
> 
> TTFN
> 
> Paul
> --
> "Trust me, I know what I'm doing" - Det. Sledgehammer
> 
> 
> 


-- 
DASNOIS Benjamin