Selaa lähdekoodia

* TextBoxBase.cs: Non multiline textboxes shouldn't take the
* enter
key. Fixes #81408.


svn path=/trunk/mcs/; revision=76143

Jackson Harper 18 vuotta sitten
vanhempi
sitoutus
e225c391ed

+ 5 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

@@ -1,3 +1,8 @@
+2007-04-23  Jackson Harper  <[email protected]>
+
+	* TextBoxBase.cs: Non multiline textboxes shouldn't take the enter
+	key. Fixes #81408.
+
 2007-04-23  Jonathan Pobst  <[email protected]>
 
 	* ToolStripItem.cs: Make GetImageSize internal.

+ 2 - 2
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs

@@ -786,7 +786,7 @@ namespace System.Windows.Forms {
 
 			switch (keyData & Keys.KeyCode) {
 				case Keys.Enter: {
-					if (accepts_return) {
+					if (accepts_return && document.multiline) {
 						return true;
 					}
 					return false;
@@ -1113,7 +1113,7 @@ namespace System.Windows.Forms {
 
 				case Keys.Enter: {
 					// ignoring accepts_return, fixes bug #76355
-					if (!read_only && (accepts_return || (FindForm() != null && FindForm().AcceptButton == null) || ((Control.ModifierKeys & Keys.Control) != 0))) {
+					if (!read_only && document.multiline && (accepts_return || (FindForm() != null && FindForm().AcceptButton == null) || ((Control.ModifierKeys & Keys.Control) != 0))) {
 						Line	line;
 
 						if (document.selection_visible) {