Solved

Internet Explorer  component - get click event?

Posted on 2002-03-14
11
153 Views
Last Modified: 2010-05-02
Hi!

Is it possible to get the "click" event from the embedded Interet Explorer component?

Falke
0
Comment
Question by:Falke
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 28

Expert Comment

by:Ark
ID: 6867600
Add reference to Microsoft HTML Object Library (MSHTML.tlb)

Dim WithEvents doc As HTMLDocument

Set doc = ie.Document

Private Sub doc_onclick()
   MsgBox "Click occure!"
End Sub
0
 

Author Comment

by:Falke
ID: 6867693
i am talking about the component .. i want to place it on a form and show html code within and if he clicks in the html code i want to get the event ...

Falke
0
 
LVL 5

Expert Comment

by:aminerd
ID: 6867925
Falke,

That's what Ark was talking about...

Andrew
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

Author Comment

by:Falke
ID: 6868073
no ... that's a "reference" no component ;) there are differences ... and btw its made with "withevents" ;)

no object on the form ;)

Falke
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6868949
No man!
You are using a webbrowser control, right?
Then, as Ark saids, set a reference to Microsoft HTML object library.
On declarations section of form put
dim withevents ieDoc  as htmldocument


'in documentcomplete event of webbrowser control, paste this code:
if (pdisp is webbrowser.object) then
   set ieDoc =webbrowser1.document
end if

and use the code provided by Ark:
Private Sub doc_onclick()
  MsgBox "Click occure!"
End Sub
0
 

Author Comment

by:Falke
ID: 6871771
yes it works fine

but i have an array of this "objects" any possibilities?

Falke
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6872069
That's not in your first question.
Where do you have that "array"?, from where they come from?
0
 

Author Comment

by:Falke
ID: 6873551
maybe i should specify my questions at "first time" ;)

i thought it's the same as a "single" one.

The Array consist of the internet explorer component. Why? I want to show in each a picture some are gif's etc ...

Falke
0
 
LVL 28

Accepted Solution

by:
Ark earned 100 total points
ID: 6873612
Just reset document on every WebBroser_GotFocus event:

Dim WithEvents doc As HTMLDocument
Dim CurrentIndex As Integer

Private Sub WebBrowser1_GotFocus(Index As Integer)
   Set doc = WebBrowser1(Index).Document
   CurrentIndex = Index
End Sub

Private Sub doc_onclick()
  MsgBox "Click occure on WebBrowser No." & CurrentIndex
End Sub
0
 
LVL 28

Expert Comment

by:Ark
ID: 6873614
BTW, take a look on my code to show animated GIFs in pictureboxes: http://www.freevbcode.com/ShowCode.Asp?ID=758

Cheers
0
 

Author Comment

by:Falke
ID: 6873629
i have already take a look at this and made a gif OCX but:

if i use it ... the GDI Resources are going down and down ... and after 24 gif's (i am using 44) the resources are at zero :(

Have tried it with IPictureDisp but it doesn't improve my gdi resources.

Falke
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

860 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