Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

olecontrol swf file in form

Status
Not open for further replies.

eyeshield21

Programmer
Aug 13, 2014
62
PH
i have a form which contains swf file and i want to put a code on
its click event but i realize that there is no click
event of the ole control..

or is it possible?
plz help..tnx
 
You could put the OLE control in a container, which will look like the ole control, and use it's CLICK event so the user thinks they are clicking the control, but they are really firing the container's event.

Then if you need to do something in the click event code with the Ole object just reference by:

ThisForm.oleControl.<propery/method> = (Some value), or whatever you want to do with the control.

Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
what do you mean container sir?.
what i have made is that i put a nother image in front of that ole but it seems
the ole always on the front of another control..
by the way tnx sir
 
Are you using Visual FoxPro? (What version?)

There is a class in VFP called a "Container". The container is just that... something to put things in. If you put a container class on your form, and then put your OLE object IN the container, then you can exert behaviors of the container onto the objects inside them.

So you can leverage the containers Click event to to do things to the ole object. To your user, it will appear they clicked the OLE object, but it's actually the container's "click" that you are using to start processes within your ole object.


Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
What OE Control are you using?
Does it have the GotFocus event? Than you can use that. It'll not happen each click, but the activation of the control triggers this event.

Bye, Olaf.
 
Yes, this works. Use GotFocus instead of Click. Only don't put the control in taborder 1, initially it should not get focus.

Bye, Olaf.
 
I tried with a messagebox() and the messagebox shows up then.

But I also already said this will not happen with each click, because it only works in the moment the control gets focus. Once it has focus already further clicks don't cause GotFocus anymore. It's not an identical event to click, it's a compromise and secondary alternative, but there is nothing better, at least nothing that simple.

If your form only has this Flash object the gotfocus will happen at form start, as it'll get focus, then it wont even work once.

You could make it work more than once by setting focus to anything else in the form in the GotFocus, because then the next click will again trigger the GotFocus event.

If you don't know yet, what the focus is and what GotFocus means, then please look it up in the help, that's very basic windows knowledge, not VFP specific. Always one window, one control of one pageframe or grid has focus. It's the control getting all keyboard messages sent to, for example.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top