Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27349

VS 2012 [RESOLVED] Option String ON - Need compatible method to rewrite this code

$
0
0
Can someone please show me a compatible way to write this so its compatible with Option Strict On? I rewrote most of my application with Option Strict Off and the below is given me issues.

Code is:

Code:

Dim myTargetElement = (From targetElement As HtmlElement In WebBrowser1.Document.GetElementsByTagName("div")
                                                                            Where targetElement.GetAttribute("className") = "guid"
                                                                            Select targetElement)
                'Thread.Sleep(2000)
                If myTargetElement(0) IsNot Nothing Then
                    Guid.Text = myTargetElement(0).InnerText

Problems raised with OS On, Errors Are:
targetElement As HtmlElement = Option Strict On disallows implicit conversions from 'Object' to 'System.Windows.Forms.HtmlElement
myTargetElement(0) = Late binding
myTargetElement(0).InnerText = Late binding

What other ways could i write this which are compatible with OS on?

Viewing all articles
Browse latest Browse all 27349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>