using System; using System.Drawing; using System.Windows.Forms; namespace MonoTest32 { class Form12 : Form { static void Main () { Application.Run (new DisplayRectangleForm ()); } private class DisplayRectangleForm : Form { public DisplayRectangleForm () { Control c = new Control (); c.BackColor = Color.Green; c.Anchor |= AnchorStyles.Bottom; c.Size = new Size (100, 100); Controls.Add (c); } // public override Rectangle DisplayRectangle // { // get { return Rectangle.Empty; } // } } public Form12 () { Console.WriteLine (this.Handle); WindowState = FormWindowState.Normal; Button b = new Button (); b.VisibleChanged += new EventHandler (b_VisibleChanged); Controls.Add (b); } void b_VisibleChanged (object sender, EventArgs e) { Console.WriteLine ("Button visible set to: {0}", (sender as Button).Visible); } } }