+2007-08-10 Jonathan Pobst <monkey@jpobst.com>
+
+ * TextBoxBase.cs: Fix SelectionLength when no text selected to match MS:
+ 1.1 2.0
+ Handle Not Created -1 0
+ Handle Created 0 0
+ [Fixes bug #82371]
+
2007-08-10 Jonathan Pobst <monkey@jpobst.com>
* ToolTip.cs: Hide the tooltip if the control is clicked to match MS behavior.
+2007-08-10 Jonathan Pobst <monkey@jpobst.com>
+
+ * TextBoxTest.cs: New test for 82371 to illustrate SelectionLength value when
+ no text is selected.
+
2007-08-09 Jonathan Pobst <monkey@jpobst.com>
* ListBoxTest.cs: Mark test MethodScaleControl as not working.
form.Close ();
}
+ [Test] // bug 82371
+ public void PropertySelectionLength ()
+ {
+ TextBox tb = new TextBox ();
+ RichTextBox rtb = new RichTextBox ();
+
+#if NET_2_0
+ Assert.AreEqual (0, tb.SelectionLength, "A1-NET20");
+ Assert.AreEqual (0, rtb.SelectionLength, "A2-NET20");
+#else
+ Assert.AreEqual (-1, tb.SelectionLength, "A1-NET11");
+ Assert.AreEqual (-1, rtb.SelectionLength, "A2-NET11");
+#endif
+
+ IntPtr i = tb.Handle;
+ i = rtb.Handle;
+
+ Assert.AreEqual (0, tb.SelectionLength, "A3");
+ Assert.AreEqual (0, rtb.SelectionLength, "A4");
+ }
[Test]
public void ModifiedTest ()