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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active X Treeview Control not responding to nodeclick event 1

Status
Not open for further replies.

tgerits

Programmer
Oct 5, 2001
23
BE
Hi All,

I have a form with a treeview in it. When I rightclicks on a node another form is loaded. Within this form there is also a treeview. But this treeview doesn't respond to nodeclick event or other events. When I load the second form from the command prompt, everything goes fine, Only when I load the form from the first one, it doesn't work.

I tried with the "autoYield" property, but It doesn't work.

Does anyone know how I can get it works or if there is a bugfix for it?


Thanks a lot!!!

Kind regards,
Tamara.
 
tgerits

This may not solve your problem, but somewhere but your forms load try using this.
SYS(2333,1) Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike,

Thanks for your input, but the problem is still there.


Regards,
 
tgerits

There must be something else at play. If I load the "solutions" (provided with VFP), as a project, and I select the "outline.scx" form (Which contains the Treeview activex), and I load it twice, both versions run properly. You may want to check the setting on the "outline.scx" to see if they match your settings. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I checked the settings but everything seems allright.
Are there any special settings?


Thanks!!
 
tgerits

I checked the settings but everything seems allright.
Are there any special settings?


Are you using a "top-level" form?
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
This is a known problem with FoxPro there is documentation on MSN, I had this exact same problem with the MS flexgrid Active X.

If you use an Active X event to load another form the events on any Active X contained on the new form will not fire.

I have an application that uses the TreView as a menu which loads forms that may contain other Active X's, when the NodeClick is fired it enables a Timer that fires 0.1 of a second later and loads the form that was selected.

I know that this is a messy work around but this is the only way it will work. I don't know if the problem has been fixed in v8.

Dazz GuiltyMaggot - The best rock band in the world!
 
Hi,

I did it with the timer you say and this works.
This is indeed not a very proper way to do it, but it's only once in a while this function is used so I'm satisfied with it.


Thanks a lot!!!

Regards,


 
This sounds like something that should have a FAQ written on it; I've used this same workaround for other problems, and it would considerably clean up if we crafted a simple function AutoLaunch, or FireLater, or some more clever name, which would create a timer in _SCREEN, and set the timer to do the proper command at a given moment in the future, like:
Code:
proc FireLater( pcCommand, pnDelay )
_SCREEN.AddObject(sys(2015),'tmrFireLater',pcCommand,pnDelay)
endproc
DEFINE CLASS tmrFireLater AS Timer
  cCommand = ''
  PROC Init( pcCommand, pnDelay )
    THIS.cCommand = pcCommand
    THIS.Interval = pnDelay
    THIS.Enabled  = .t.
  ENDPROC
  PROC Timer
    THIS.Enabled = .F.
    LOCAL lcCmd
    lcCmd = THIS.cCommand
    &lcCmd
    THISFORM.RemoveObject( THIS.Name )
  ENDPROC
ENDDEFINE

Put the above code in a file called "FireLater.prg", then to use it, just:

DO FireLater WITH "Wait Window 'Time is Up!'", 3000
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top