[Mono-winforms-list] Windows not the correct size

Paul paul@all-the-johnsons.co.uk
Mon, 27 Dec 2004 02:42:58 +0000


--=-pS/B9WjMu5H/AbGZgyJl
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi,

I'm using MWF from the development branch of mcs here and have hit upon
a problem, which, IIRC occurs even in the normal branch.

If I have something like the following

using System;
using System.Windows.Forms;

namespace WelcomeGUI
{
   class Welcome4
   {
      static void Main( string[] args )
      {
         MessageBox.Show( "Welcome\nto\nC#\nprogramming!" );
      }
   }
}

This compiles fine and starts up as a small window with nothing in it at
all. If I expand the window slightly, all of the text appears as does an
OK button.

This can be further demonstrated with this code

using System;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;

public class FirstForm : Form
{
  private Container components;
  private Label howdyLabel;
 =20
  public FirstForm()
  {
    InitialiseComponent();
  }

  private void InitialiseComponent()
  {
    components =3D new Container();
    howdyLabel =3D new Label();

    howdyLabel.Location =3D new Point(12, 116);
    howdyLabel.Text =3D "Howdy, Partner!";
    howdyLabel.Size =3D new Size(267, 40);
    howdyLabel.AutoSize =3D true;
    howdyLabel.Font =3D new Font ("Sans Serif", 26,=20
				System.Drawing.FontStyle.Bold);
    howdyLabel.TabIndex =3D 0;
    howdyLabel.Anchor =3D AnchorStyles.None;
    howdyLabel.TextAlign =3D ContentAlignment.MiddleCenter;

    Text =3D "First form";
    Controls.Add(howdyLabel);
  }

  public static void Main()
  {
    Application.Run(new FirstForm());
  }
}

In this case, only the word "How" is displayed (something has gone badly
wrong here). Interestingly, it appears at the bottom of the window. If
the window is expanded side ways, the text jumps to the middle (where it
should be).

Okay, I know it's too early to start filing these into bugzilla, but
it's worth mentioning now.

TTFN

Paul

P.S. Clicking on the close window icon does nothing, apps currently need
to be exited by terminating them in a task window. Annoying, but not a
problem ;-)
--=20
"He's not the Messiah, he's a very naughty boy!"
- Life of Brian, Monty Python

--=-pS/B9WjMu5H/AbGZgyJl
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQBBz3ayusSVe5EZv3wRAkwHAJ0X+bUzE/qTaUoJ1a8SMY3Q8Bxp+QCfbfmG
jmNJH5Cs6FBf0Dl/tQcP4B4=
=+qFs
-----END PGP SIGNATURE-----

--=-pS/B9WjMu5H/AbGZgyJl--