For those that haven't already made this change.
Often, when creating "re-sizeable" forms, and using the new VFP 9 "Anchor"
properties - you find that your lookup command buttons are not "Anchoring"
where the "vpmctrls.vcx" "textbox_" ( or someother objects) have resized and
anchored...
There are a number of ways to do this, from the "ProCtrls" or the "DevCtrls"
class libraries, but to keep this simple I will reference the code in
"VPMCtrls.vcx". One could then move over to one of the other subclassed
class libraries very easy.
1. Open VPMCtrls.vcx and open the object called "textbox_".
2. Examine the Init() event of the "textbox_"
3. Search for the following code, about 3/4 ways down in Init code:
* Change the properties of the new lookup CommandButton.
This.Parent.&slcCmdName..TabStop = .F.
This.Parent.&slcCmdName..TabIndex = This.TabIndex
This.Parent.&slcCmdName..cName_DDD = This.cName_DDD
This.Parent.&slcCmdName..cName_DDTV = This.cName_DDTV
This.Parent.&slcCmdName..cName_DDF = This.cName_DDF
This.Parent.&slcCmdName..lLookupCommandButton = .T.
This.Parent.&slcCmdName..cLookupFor = This.Name
This.Parent.&slcCmdName..Height = 20
This.Parent.&slcCmdName..Width = 17
This.Parent.&slcCmdName..Left = This.Left+This.Width+2
This.Parent.&slcCmdName..Top = This.Top+INT((This.Height-20)/2)
4. Add the following line (you will probably do this in "ProCtrls" or
"DevCtrls").
This.Parent.&slcCmdName..Anchor = This.Anchor
That's it - now, when you resize your form, and you have indicated that you
want a lookup command button to show up, it will resize the same as the
object it is tied to. You can repeat this for any other object that has the
ability in VPME to dynamically add a "Lookup Command Button".
( easier to do this at object creation - then to dynamically search for the
object and alter it at runtime for each and every case... ).
Regards,
John C. Gunvaldson
www.fox-net.com
http://foxnetwest.spaces.live.com/
San Diego, CA