Hello everyone, there is a webBrowser control, it has an example code:

<a href = "http://yandex.ru">Это Яндекс!</a> 

And I need to do a check:

If the variable begins with ("http: // yandex") {it means to focus on this element. }

The fact is that I did how to make the conditions for checking the string, but I did not understand how to focus. I looked at MSDN there, I did not understand anything at all about a small article about this.

    1 answer 1

    I myself thought of how to do this, for those who are interested in writing code here.

     HtmlElementCollection elemet = webBrowser1.Document.GetElementByTagName("a"); foreach(HtmlElement elem in element) { string link = elem.GetAttribute("href"); if(link.StartWith("http://yandex")) { elem.Focus(); } }