Hi all,
I have a problem at the moment in that it appears if I have an Assign
method on either the Width or Height property of a Control, that assign
method is executed when the property is accessed.
If I have both assign & access methods, then assign will fire when
I set the property, but BOTH access and assign will fire when I read
the property.
I've tested this on Labels, Containers and Textboxes in VFP 9 & 6, and
it happens in all cases - only for Width and Height though.
Anyone have an idea as to why ?
eg.
DEFINE CLASS TestLabel AS Label
PROCEDURE Width_ACCESS
MESSAGEBOX("Label Width Access")
RETURN THIS.Width
ENDPROC
PROCEDURE Width_ASSIGN
LPARAMETERS vNewVal
MESSAGEBOX("Label Width Assign")
THIS.Width = m.vNewVal
ENDPROC
ENDDEFINE
m.lnWidth = THISFORM.TestLabel1.Width
will result in both Messages being displayed.
Note: Assign will fire whether Access exists or not, and the reverse doesnt happen.
ie. Access doesnt (and shouldnt) fire when we set the property.
cheers,
Matt.