[Mono-devel-list] Winforms failure

Paul paul at all-the-johnsons.co.uk
Sat Jun 26 16:58:56 EDT 2004


Using the code below, when I compile and run the app, I get a Winform
error box which says

"The application has produced an exception. Press 'Continue' if you want
the application to try to continue its execution'

In the box below that,

"Invalid parameter. A null reference or invalid value was f" (the
wrapping seems to be jiggered).

The three buttons below that are unmarked. From what I can see, the code
is fine, I'm assuming it's because winforms is only in alpha that the
problem is there and also that when I use mcs with winforms, that unlike
System.Drawing, mcs doesn't make the recommendation to use -r System.



using System; 
using System.Drawing; 
using System.Windows.Forms; 
public class TestTextBox : Form { 
 TextBox tb = new TextBox(); 
 TextBox tb2 = new TextBox(); 
 public static void Main() { 
  Application.Run(new TestTextBox()); 
 TestTextBox() { 
  // some form text. 
  Text = "Textbox test"; 
  // label 
  Label l = new Label(); 
  l.Size = new Size(300, 16); 
  l.Text = "Give me your name please:"; 
  l.Parent = this; 
  l.Location = new Point(1,10); 
  // textbox 
  tb.Location = new Point(1,30); 
  tb.MaxLength = 100; 
  tb.Size = new Size(200,16); 
  tb.Parent = this; 
  // textbox 
  tb2.Location = new Point(1,50); 
  tb2.MaxLength = 100; 
  tb2.Size = new Size(200,16); 
  tb2.Parent = this;   
  // Button 
  Button b = new Button(); 
  b.Location = new Point(1,70); 
  b.Text = "Press me"; 
  b.Parent = this; 
  b.Click += new EventHandler(ButtonOnClick); 
 void ButtonOnClick(object obj, EventArgs ea) { 
  tb2.Text = tb.Text; 
"If I face my God tomorrow, I can tell Him I am innocent.
I've never harmed anyone. I have cheated no one. 
I have deceived no one. I have hurt no one. 
Except myself. And that He will forgive me." - Hans Holzel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040626/15d5bc4b/attachment.bin 

More information about the Mono-devel-list mailing list