diff --git a/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/CS/Form1.cs b/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/CS/Form1.cs index dd10e53c233..cf28d572d0c 100644 --- a/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/CS/Form1.cs +++ b/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/CS/Form1.cs @@ -307,19 +307,19 @@ private void AddTopPageMessage(String message) { HtmlDocument doc = webBrowser1.Document; - // Do not insert the warning again if it already exists. - HtmlElementCollection returnedElems = doc.All.GetElementsByName("ADatumWarningDiv"); - if ((returnedElems != null) && (returnedElems.Count > 0)) + // Do not insert the warning again if it already exists. + HtmlElementCollection returnedElems = doc.All.GetElementsByName("ADatumWarningDiv"); + if ((returnedElems != null) && (returnedElems.Count > 0)) { - return; + return; } - HtmlElement divElem = doc.CreateElement("DIV"); - divElem.Name = "ADatumWarningDiv"; - divElem.Style = "background-color:black;color:white;font-weight:bold;width:100%;"; - divElem.InnerText = message; - - divElem = doc.Body.InsertAdjacentElement(HtmlElementInsertionOrientation.AfterBegin, divElem); + HtmlElement divElem = doc.CreateElement("DIV"); + divElem.Name = "ADatumWarningDiv"; + divElem.Style = "background-color:black;color:white;font-weight:bold;width:100%;"; + divElem.InnerText = message; + + divElem = doc.Body.InsertAdjacentElement(HtmlElementInsertionOrientation.AfterBegin, divElem); } } //