[Mono-winforms-list] Re: Problems with Button........
mandrake
ievazquez2002@yahoo.com.mx
Sun, 28 Nov 2004 20:35:57 -0600 (CST)
--0-1403034362-1101695757=:61417
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Hi everybody,
I just started playing with System.Windows.Forms on Windows.....and I got the error when I set Button's Text property. It works with .net 1.1
This is my code..
using System.Windows.Forms;
using System;
public class Form1:Form
{
Button b;
public Form1()
{
b = new Button();
b.Text = "Accept";
b.Click += new EventHandler(b_Click);
this.Controls.Add(b);
}
private void b_Click(object sender,EventArgs e)
{
System.Console.WriteLine("clicked");
}
static void Main()
{
Application.Run(new Form1());
}
}
with mono 1.0.4 I got
C:\usuarios\Development\mono>mono window2.exe
Unhandled Exception: System.ArgumentException: Invalid Parameter. A null referen
ce or invalid value was found.
in <0x00073> System.Drawing.GDIPlus:CheckStatus (System.Drawing.Status)
in <0x00182> System.Drawing.Font:FromHfont (intptr)
in <0x00015> System.Windows.Forms.Control:get_DefaultFont ()
in <0x001af> System.Windows.Forms.Control:.ctor ()
in <0x00010> System.Windows.Forms.ScrollableControl:.ctor ()
in <0x00012> System.Windows.Forms.ContainerControl:.ctor ()
in <0x00016> System.Windows.Forms.Form:.ctor ()
in <0x0000f> Form1:.ctor ()
in <0x0004c> (wrapper remoting-invoke-with-check) Form1:.ctor ()
in <0x0001b> Form1:Main ()
with mono 1.1.2
Invalid Parameter. A null reference or invalid value
Thanks in advance
---------------------------------
Do You Yahoo!?
Yahoo! Net: La mejor conexión a internet y 2GB en tu buzón de Correo Yahoo! por $100 al mes.
--0-1403034362-1101695757=:61417
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
<DIV>Hi everybody,</DIV>
<DIV> </DIV>
<DIV>I just started playing with System.Windows.Forms on Windows.....and I got the error when I set Button's Text property. It works with .net 1.1</DIV>
<DIV> </DIV>
<DIV>This is my code..</DIV>
<DIV> </DIV>
<DIV>using System.Windows.Forms;<BR>using System;<BR>public class Form1:Form<BR>{<BR> Button b;<BR> public Form1()<BR> {<BR> b = new Button();<BR> b.Text = "Accept";<BR> b.Click += new EventHandler(b_Click);<BR> this.Controls.Add(b);</DIV>
<DIV> }</DIV>
<DIV> private void b_Click(object sender,EventArgs e)<BR> {<BR> System.Console.WriteLine("clicked"); <BR> } </DIV>
<DIV> static void Main()<BR> {<BR> Application.Run(new Form1());<BR> }<BR>} <BR></DIV>
<DIV>with mono 1.0.4 I got </DIV>
<DIV><BR>C:\usuarios\Development\mono>mono window2.exe</DIV>
<DIV>Unhandled Exception: System.ArgumentException: Invalid Parameter. A null referen<BR>ce or invalid value was found.<BR>in <0x00073> System.Drawing.GDIPlus:CheckStatus (System.Drawing.Status)<BR>in <0x00182> System.Drawing.Font:FromHfont (intptr)<BR>in <0x00015> System.Windows.Forms.Control:get_DefaultFont ()<BR>in <0x001af> System.Windows.Forms.Control:.ctor ()<BR>in <0x00010> System.Windows.Forms.ScrollableControl:.ctor ()<BR>in <0x00012> System.Windows.Forms.ContainerControl:.ctor ()<BR>in <0x00016> System.Windows.Forms.Form:.ctor ()<BR>in <0x0000f> Form1:.ctor ()<BR>in <0x0004c> (wrapper remoting-invoke-with-check) Form1:.ctor ()<BR>in <0x0001b> Form1:Main ()</DIV>
<DIV> </DIV>
<DIV>with mono 1.1.2 <BR>Invalid Parameter. A null reference or invalid value<BR></DIV>
<DIV>Thanks in advance</DIV><p><br><hr size=1><b>Do You Yahoo!?</b><br>
<a href="http://net.yahoo.com.mx"><b>Yahoo! Net</b></a>: La mejor conexión a internet y 2GB en tu buzón de Correo Yahoo! por
<a href="http://net.yahoo.com.mx/">$100 al mes</a>.<br>
--0-1403034362-1101695757=:61417--