Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-09-25
4
Medium Priority
?
462 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
  • 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

971 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