Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get to a controls using in a complicated form w/
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01172607
Message ID:
01172628
Views:
16
Hi Bhavbuti,

I don't know of any way to quickly find an object within the containers of your form. I had thought that you might be able to use the Class Browser to search for "cmd_" but I tried that and it has not worked for me.

What I would do is try and find all objects named "cmd_button2" within your form. It is not always recommended but it is possible to view scx and vcx files as tables. You can then search for all records that have an ObjName field of "cmd_button2" and view the parent field for those records. This will tell you the names of the containers you need to look in.

The code I would use to do this is:
lcMyForm = GETFILE("scx")

USE &lcMyForm. ALIAS MyForm NOUPDATE IN 0

SELECT 			MyForm.Parent ;
	FROM 		MyForm ;
	INTO CURSOR MyContainers ;
	WHERE 		UPPER(MyForm.ObjName) = 'CMD_BUTTON2' ;
		AND 	!EMPTY(MyForm.Parent)

USE IN MyForm

SELECT MyContainers
BROWSE
You should see a memo field for every cmd_Button2 that you have added directly to container within your form; this field contains the path to the parent container.

Once you know the names of the containers that hold cmd_Button2 you should be able to use the first three characters of their name in the properties cbo - pause - then type cmd you should then be closer to your cmd_Button2.

This method will not work for container classes that you have added the control to separately. If you have created your pageframes as separate classes; then added your cmd_Button2 to them; then added the pageframe to your form: in that case you will have to look at your pageframe class itself rather than the form.

I am sorry I cannot be more help but that is how I would locate an object I had mislaid within a complicated form.

Regards,
Ben Sugden

"Remember to enjoy hunting - and that means relishing the search for the product that has never been advertised or placed handily at the front of the shop; Life begins on the uppermost shelf, avoid guide books and top 10's like the plague." - Ramsey Dukes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform