[Mono-bugs] [Bug 79184][Nor] New - Setting TextBox.SelectedText doesn't update SelectionStart properly

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Aug 27 09:26:23 EDT 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by kuba.brecka at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=79184

--- shadow/79184	2006-08-27 09:26:23.000000000 -0400
+++ shadow/79184.tmp.20445	2006-08-27 09:26:23.000000000 -0400
@@ -0,0 +1,53 @@
+Bug#: 79184
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: peter at novonyx.com                            
+ReportedBy: kuba.brecka at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Setting TextBox.SelectedText doesn't update SelectionStart properly
+
+Using SVN head, the following reproduce code shows the bug in Mono. When
+setting TextBox.SelectedText, it seems that SelectionStart doesn't get
+updated accordingly. Tested on Windows.
+
+Expected result:
+A messagebox with "8".
+
+Actual result:
+A messagebox with "3".
+
+Reproduce code:
+using System;
+using System.Windows.Forms;
+
+namespace MonoTest21
+{
+    public class Form1 : Form
+    {
+        static void Main()
+        {
+            Application.Run(new Form1());
+        }
+
+        public Form1()
+        {
+            TextBox T = new TextBox();
+            T.Text = "Hello world";
+            T.SelectionStart = 3;
+            T.SelectionLength = 2;
+            T.SelectedText = "olleh";
+            MessageBox.Show(T.SelectionStart.ToString());
+            Controls.Add(T);
+        }
+    }
+}


More information about the mono-bugs mailing list