It looks like your doing this inside the form load event. Perhaps the textbox isn't fully loaded yet. Perhaps creating the textbox in runtime would ensure it get's fully loaded first.
tinstaafl
Nearly a Posting Virtuoso
1,329 posts since Jun 2010
Reputation Points: 355
Solved Threads: 232
Skill Endorsements: 14
sorry I weas little punchy whenm i worte that, the only thing I can see is put a break on then line where your adding text to the textbox and see if tableElem.InnerText is getting the right data. If isn't getting the right data, you might need a wait loop until it does. Also your second example appears to be missing some code.
tinstaafl
Nearly a Posting Virtuoso
1,329 posts since Jun 2010
Reputation Points: 355
Solved Threads: 232
Skill Endorsements: 14
Are you sure that tableElem has a value and is not nothing?
The DocumentCompleted event can fire many times when loading an url, I've found this technique very useful to make sure that the document is the one I want. Try this in the DecomentCompleted handler.
If webBrowserX.Url = e.Url Then
Dim tableElem As HtmlElement = webBrowserX.Document.GetElementById("count-in")
If tableElem IsNot Nothing Then
TextBox1.Text = TextBox1.Text & tableElem.InnerText
Else
Stop ' this is only for debugging
End If
End If
TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418
Solved Threads: 148
Skill Endorsements: 13
it might still be a timing issue. You're firing the event after visually confirming the page is loaded. The software may not do that the way it sits. A simple conditional loop like TinTinMN suggested could be the solution. Either way putting a simple break on that line and examining your variables will tell the best way.
tinstaafl
Nearly a Posting Virtuoso
1,329 posts since Jun 2010
Reputation Points: 355
Solved Threads: 232
Skill Endorsements: 14