• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

Internet Explorer component - get click event?

Hi!

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

Falke
0
Falke
Asked:
Falke
  • 5
  • 3
  • 2
  • +1
1 Solution
 
ArkCommented:
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
 
FalkeAuthor Commented:
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
 
aminerdCommented:
Falke,

That's what Ark was talking about...

Andrew
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
FalkeAuthor Commented:
no ... that's a "reference" no component ;) there are differences ... and btw its made with "withevents" ;)

no object on the form ;)

Falke
0
 
Richie_SimonettiIT OperationsCommented:
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
 
FalkeAuthor Commented:
yes it works fine

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

Falke
0
 
Richie_SimonettiIT OperationsCommented:
That's not in your first question.
Where do you have that "array"?, from where they come from?
0
 
FalkeAuthor Commented:
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
 
ArkCommented:
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
 
ArkCommented:
BTW, take a look on my code to show animated GIFs in pictureboxes: http://www.freevbcode.com/ShowCode.Asp?ID=758

Cheers
0
 
FalkeAuthor Commented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now