Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BindEvent
Message
From
14/03/2014 13:33:22
 
 
To
14/03/2014 12:07:33
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01596538
Message ID:
01596549
Views:
90
>Hi all
>
>I'm using the BackStyle_Access method made popular by Craig Boyd and Burkhard Stiller. The method is added to a container in a column. By the way, is it only the container that makes the grid check the back_style? As you might know, the access method fires twice per row. I'm trying to avoid that, if possible. I will have to add the access method to a container that is very widely used. That means the access method will fire for every row and every column, even if I only want it for one column. It's also making tracing a bit of a pain since if I set step on, each of the calls to BackStyle_Access fires.
>
>I thought I remembered that I could BindEvent to the BackStyle property so that when the grid interrogates the value on the container in the one column, I could trigger my routine. The help says we can bind to properties. It fires the delegate if I change a property, but not when I interrogate it. Is there flag I missed? The help does not mention that interrogating a property's value will not trigger the delegate.
>

Pretty sure BindEvent() fires only on changes to properties, not on accesses. Maybe create a specific subclass of the container for use in this column? Or, to cut down the code that runs, add a property to indicate whether you want to do whatever it is you're doing with method. Set it to true for the one column and first thing in the method:

IF This.lDoThisThing
...
ENDIF

While it won't keep it from firing, it will mean just one line of code to run when it does fire.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform