[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Internet Explorer  component - get click event?

Posted on 2002-03-14
11
Medium Priority
?
158 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
[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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 400 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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

649 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