[Mono-winforms-list] Windows not the correct size
Peter Dennis Bartok
peter@novonyx.com
Sun, 26 Dec 2004 22:35:06 -0700
Paul,
Yeah, we are aware of those issues. We run into them every day yet it seems
that there's always something more pressing to be worked on. I've had to
resize my test app's window for the last 4 weeks to make my edit control
show up, you'd think I'd have it fixed by now :-) Often, though, I keep the
problem around until I have time to look into and fully understand what's
happening, to make sure the 'fix' isn't just a 'workaround' that's hiding
the real problem.
Peter
-----Original Message-----
From: "Paul" <paul@all-the-johnsons.co.uk>
To: "winforms" <mono-winforms-list@lists.ximian.com>
Date: Sunday, 26 December, 2004 19:44
Subject: [Mono-winforms-list] Windows not the correct size
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;
public FirstForm()
{
InitialiseComponent();
}
private void InitialiseComponent()
{
components = new Container();
howdyLabel = new Label();
howdyLabel.Location = new Point(12, 116);
howdyLabel.Text = "Howdy, Partner!";
howdyLabel.Size = new Size(267, 40);
howdyLabel.AutoSize = true;
howdyLabel.Font = new Font ("Sans Serif", 26,
System.Drawing.FontStyle.Bold);
howdyLabel.TabIndex = 0;
howdyLabel.Anchor = AnchorStyles.None;
howdyLabel.TextAlign = ContentAlignment.MiddleCenter;
Text = "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 ;-)
--
"He's not the Messiah, he's a very naughty boy!"
- Life of Brian, Monty Python