Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Raising An Event From the Webbrowser

Posted on 2002-07-15
3
Medium Priority
?
193 Views
Last Modified: 2010-07-27
I want to build a small table using HTML and then display this table in the Webbrowser Control.  When a user clicks on a row, I want to let the (container) visual basic form know which row was clicked.  

After the row is clicked, a corrisponding routine will be executed by the vb form.

How do I perform this interaction without using a timer to poll the HTML document?
0
Comment
Question by:khampton
[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
3 Comments
 
LVL 2

Expert Comment

by:Ber
ID: 7155821
I'm not sure but I think you need to write an Event handler to do this, an example of an event handler in VB is available here...

http://www.codeguru.com/vb/articles/1721_GridResize_Src.zip

Info on it is available here...

http://www.codeguru.com/vb/articles/1721.shtml


Cheers...
Ber...
0
 
LVL 1

Expert Comment

by:soferstam
ID: 7155895
Did you try parent.parent.pa....  or something like this from javascript?
0
 
LVL 28

Accepted Solution

by:
AzraSound earned 200 total points
ID: 7157208
Should work something like:

Dim WithEvents htmlDoc As HTMLDocument


Private Sub WebBrowser_DocumentComplete(...)
   If (pDisp Is WebBrowser.object) Then
      Set htmlDoc = WebBrowser.Document
   End If
End Sub

Private Sub htmlDoc_onclick()
   MsgBox window.event.srcElement.<attribute-name>
End Sub


What will you use to distinguish the rows?  HTML rows arent assigned numbers, so to speak, by default, I dont think.  Perhaps you could number them manually using their "id" attribute and use srcElement.id
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 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