Solved

vb.net how to click in a table by webbrowser vb 2008 express

Posted on 2011-09-25
4
451 Views
Last Modified: 2012-05-12
helo friends, i am need click in a link in a tabe in vb.net
normal buttons i am use
WebBrowser1.Document.GetElementById("mario").InvokeMember("click")
this html is
<table id="tbMenuVertical" class="tbMenuVertical" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top">
<div id="divContainerMenu" class="divContainerMenu">
<table id="tbRetraltilPai1" class="tbItemPaiSlc" onmouseout="mudaClassePai('1',2)" onmouseover="mudaClassePai('1',1)">
<tbody>
<tr>
<td class="tdTituloMenuPai" colspan="2">
<a class="aMenuNomeSel" href="#" onclick="mudaClasseLink(this,1,0,0);CloseAll();ajaxProcessUrl('/aapj/marios/sndnnd.ba', tratarResposta);return false;">Marcação online</a>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
please help me for click in this. thanks
0
Comment
Question by:kidd12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 36599507
The HTMLTable element does have the "click" event, so did you try to use the same code?  Does the table have an ID?
0
 

Author Comment

by:kidd12
ID: 36601959
no have id, i am trying this
Dim doc As Object
        Dim element As Object
        Dim elemento As Object
        Dim i As Integer
        doc = webBrowser1.Document as HtmlDocument
        element = doc.links
        For i = 0 To element.count - 2

            elemento = element.item(i)
            If InStr(Endereco.Text, elemento.outerText) > 0 Then
                elemento.InvokeMember("click")
            End If
        Next
and got error end of statement expected
please help me for use this code. thanks
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 36601993
What line do you get the exception on? My guess is that you copied from C# code.

Correction:
doc = TryCast(webBrowser1.Document, HtmlDocument)

Open in new window


You don't need to cast the document to HtmlDocument, since that is what the type is already.

You can use GetElementsByTagName to limit the search to just the <table> elements.
0
 

Author Closing Comment

by:kidd12
ID: 36602085
thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question