[Mono-bugs] [Bug 82371][Wis] New - TextBox.SelectionLength method returns -1 if nothing selected

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Aug 8 09:10:25 EDT 2007


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 migliore.carmelo at gmail.com.

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

--- shadow/82371	2007-08-08 09:10:25.000000000 -0400
+++ shadow/82371.tmp.9263	2007-08-08 09:10:25.000000000 -0400
@@ -0,0 +1,69 @@
+Bug#: 82371
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Wishlist
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: migliore.carmelo at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: TextBox.SelectionLength method returns -1 if nothing selected
+
+Description of Problem:
+   TextBox.SelectionLength method returns -1 if nothing selected
+   A sample is joined
+
+Compilation :  mcs -r:System,System.Windows.Forms test.cs
+
+Steps to reproduce the problem:
+   Try the test case
+
+Actual Results:
+   If nothing is selected : -1
+
+Expected Results:
+   It should return 0 in this case
+
+----------------
+
+using System;
+using System.Windows.Forms;
+
+public class test : Form
+{
+	private Button btn;
+	private TextBox txt;
+		
+	public test()
+	{	
+		txt = new TextBox();
+		txt.Dock = DockStyle.Top;
+		txt.Text = "Sample";
+		
+		btn = new Button();
+		btn.Dock = DockStyle.Top;
+		btn.Text = "Click to Show SelectionLength";
+		btn.Click += new EventHandler(this.On_Click);
+		
+		this.Controls.Add(btn);
+		this.Controls.Add(txt);		
+	}		
+
+	public static void Main()
+	{	
+		test fen = new test();
+		Application.Run(fen);	
+	}
+	
+	private void On_Click(object sender, EventArgs e)
+	{
+		MessageBox.Show("Selectionlength : "+txt.SelectionLength);							
+	}	
+}


More information about the mono-bugs mailing list