From 749942b86807e4a13aad81ffafb7695709c102c1 Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Wed, 3 Oct 2007 02:48:36 +0000 Subject: [PATCH] 2007-10-02 Jonathan Pobst * ComboBox.cs: For the 1.1 profile, the default SelectedText is string.Empty, test failed from previous change. svn path=/trunk/mcs/; revision=86793 --- .../System.Windows.Forms/ChangeLog | 5 +++++ .../System.Windows.Forms/ComboBox.cs | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index c61a700760c..48c8efc5a9a 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2007-10-02 Jonathan Pobst + + * ComboBox.cs: For the 1.1 profile, the default SelectedText is + string.Empty, test failed from previous change. + 2007-10-02 Jonathan Pobst * TextBoxBase.cs: For the 1.1 profile, the default SelectedText diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs index 473ff526de4..4c183730e71 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs @@ -669,9 +669,16 @@ namespace System.Windows.Forms public string SelectedText { get { if (dropdown_style == ComboBoxStyle.DropDownList) - return ""; + return string.Empty; - return textbox_ctrl.SelectedText; + string retval = textbox_ctrl.SelectedText; + +#if ONLY_1_1 + // On 1.1, the textbox will return null, combobox returns "" + if (retval == null && !textbox_ctrl.IsHandleCreated) + return string.Empty; +#endif + return retval; } set { if (dropdown_style == ComboBoxStyle.DropDownList) -- 2.25.1