diff --git a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/FormatControl.cs b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/FormatControl.cs index 3073d163d6d..0ce08ea59ba 100644 --- a/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/FormatControl.cs +++ b/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/FormatControl.cs @@ -261,7 +261,7 @@ private void UpdateControlVisibility(FormatTypeClass formatType) } tableLayoutPanel1.SuspendLayout(); - secondRowLabel.Text = ""; + secondRowLabel.Text = string.Empty; // process the decimalPlacesLabelVisible if (formatType.DropDownVisible) @@ -315,14 +315,7 @@ private void UpdateControlVisibility(FormatTypeClass formatType) dateTimeFormatsListBox.Visible = false; } - if (secondRowLabel.Text == "") - { - secondRowLabel.Visible = false; - } - else - { - secondRowLabel.Visible = true; - } + secondRowLabel.Visible = secondRowLabel.Text.Length > 0; tableLayoutPanel1.ResumeLayout(true /*performLayout*/); } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowser.cs b/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowser.cs index e2d99481162..7300683241a 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowser.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/WebBrowser.cs @@ -611,7 +611,7 @@ public Uri Url } set { - if (value != null && value.ToString() == "") + if (value != null && value.ToString().Length == 0) { value = null; }