Ejemplo n.º 1
0
	   public void TabStopChangedEventsOrder ()
	     {
		     string[] EventsWanted = {
			     "OnHandleCreated",
			       "OnBindingContextChanged",
			       "OnBindingContextChanged"
		     };
		     Form myform = new Form ();
		     myform.ShowInTaskbar = false;
		     myform.Visible = true;
		     MyLabel l = new MyLabel ();
		     myform.Controls.Add (l);
		     l.TabStop = true;
PrintList("TabStopChanged", l.Results);
		     Assert.AreEqual (EventsWanted, ArrayListToString (l.Results));
		     myform.Dispose();
	     }
Ejemplo n.º 2
0
	   public void PaintEventsOrder ()
	     {
		     string[] EventsWanted = {
			     "OnHandleCreated",
			       "OnBindingContextChanged",
			       "OnBindingContextChanged",
			       "OnInvalidated",
			       "OnInvalidated",
			       "OnPaint"
		     };
		     Form myform = new Form ();
		     myform.ShowInTaskbar = false;
		     myform.Visible = true;
		     MyLabel l = new MyLabel ();
		     myform.Controls.Add (l);
		     l.TextAlign = ContentAlignment.TopRight;
		     l.Refresh ();
		     Assert.AreEqual (EventsWanted, ArrayListToString (l.Results));
		     myform.Dispose();
	     }
Ejemplo n.º 3
0
	   public void KeyPressEventsOrder ()
	     {
		     string[] EventsWanted = {
			     "OnHandleCreated",
			       "OnBindingContextChanged",
			       "OnBindingContextChanged",
			       "OnKeyDown,A",
			       "OnKeyPress,a",
			       "OnKeyUp,A"
		     };
		     Form myform = new Form ();
		     myform.ShowInTaskbar = false;
		     myform.Visible = true;
		     MyLabel l = new MyLabel ();
		     myform.Controls.Add (l);
		     l.KeyPressA ();

		     Assert.AreEqual (EventsWanted, ArrayListToString (l.Results));
		     myform.Dispose();
	     }
Ejemplo n.º 4
0
	   public void ImeModeChangedChangedEventsOrder ()
	     {
		     string[] EventsWanted = {
			     "OnHandleCreated",
			       "OnBindingContextChanged",
			       "OnBindingContextChanged",
			       "OnImeModeChanged"
		     };
		     Form myform = new Form ();
		     myform.ShowInTaskbar = false;
		     myform.Visible = true;
		     MyLabel l = new MyLabel ();
		     myform.Controls.Add (l);
		     l.ImeMode = ImeMode.Katakana;

		     Assert.AreEqual (EventsWanted, ArrayListToString (l.Results));
		     myform.Dispose();
	     }
Ejemplo n.º 5
0
	   public void BackgroundImageChangedEventsOrder ()
	     {
		     string[] EventsWanted = {
			     "OnHandleCreated",
			       "OnBindingContextChanged",
			       "OnBindingContextChanged",
			       "OnBackgroundImageChanged",
			       "OnInvalidated"
		     };
		     Form myform = new Form ();
		     myform.ShowInTaskbar = false;
		     myform.Visible = true;
		     MyLabel l = new MyLabel ();
		     myform.Controls.Add (l);
		     l.BackgroundImage = Image.FromFile ("Test/System.Windows.Forms/bitmaps/a.png");

		     Assert.AreEqual (EventsWanted, ArrayListToString (l.Results));
		     myform.Dispose();
	     }
Ejemplo n.º 6
0
	   public void AutoSizeChangedEventsOrder ()
	     {
		     string[] EventsWanted = {
			     "OnHandleCreated",
			       "OnBindingContextChanged",
			       "OnBindingContextChanged",
			       "OnSizeChanged",
			       "OnResize",
			       "OnInvalidated",
			       "OnLayout",
			       "OnAutoSizeChanged"
		     };
		     Form myform = new Form ();
		     myform.ShowInTaskbar = false;
		     myform.Visible = true;
		     MyLabel l = new MyLabel ();
		     myform.Controls.Add (l);
		     l.AutoSize = true;

		     Assert.AreEqual (EventsWanted, ArrayListToString (l.Results));
		     myform.Dispose();
	     }
Ejemplo n.º 7
0
	   public void KeyDownTest ()
	     {
		     Form myform = new Form ();
		     myform.ShowInTaskbar = false;
		     myform.Visible = true;
		     MyLabel l = new MyLabel ();
		     l.Visible = true;
		     myform.Controls.Add (l);
		     l.KeyDown += new KeyEventHandler (Label_KeyDownEventHandler);
		     l.KeyPressA ();

		     Assert.AreEqual (true, eventhandled, "K1");
		     eventhandled = false;
		     myform.Dispose();
	     }