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
Solved

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

Posted on 2011-09-25
4
430 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 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Help 27 57
VB.NET 2008 Winforms Signing 13 30
Change to file doesn't show up 16 50
how to just get time from a date 6 31
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 need to start windows update installation remotely or as a scheduled task you will find this very helpful.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

791 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