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

Adding Formset Properties

Status
Not open for further replies.

crogec

Programmer
May 10, 2002
16
US
VFP5.0
I had a need to add a property to a form within a formset that already existed. I discovered I could add a property to the formset but not to any of the forms within the formset. Can any of you shed some light on why, and how would one work around this apparent restriction? In my case I settled for building separate forms resulting in a bit of code changes etc. That seems a bit of the long way around. Is there a better way?

Thanks,
George
 
Hi George,

ThisFormSet.Form1.AddProperty("myProperty","myPropValue")

Is this what you are looking ?
:)

ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Ramani, thanks for you response.
Here is what I tried.
I opened my project, added a new form then from the menu, created a formset, then I added another form to the formset.
I now have a formset with two forms in it. I then attempted to add a property to say, form1 of the formset by selecting 'New Property' from the menu.
The new property was added to the formset properties and not to the specific form I intended; that is to say, I wanted the new property to be added to form1 only but it was added to the formset.
I hope this is a bit clearer. I wanted the property to be unique to form1.

I did try your suggestion and got an error message to the effect:'Property ADDPROPERTY is not found.'

Does your suggestion apply to VFP5.0?
Thanks,
George
 
All,

I think I may have stumbled on part of the answer. VFP5.0 apparently does not support 'AddProperty'.

But, my question still is, can anyone explain the reason/logic I cannot add a unique property to a form in a formset or if added to the formset, is this property available to all forms in the formset?

Thanks again,
George
 
crogec

1. Properties add to a formset will be place within the formset itself not the form.
2. Add the property at design time, not at runtime.

Here ia what I did, to test.
1. create a form
2. Create a formset from it.
3. Add a new form to the formset
3. From the menu Form->New property. And that places itself at the formset level.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
it happens that way.

If you create a form & add a property or method to the form, then create a formset - the (added) form properties/methods become transferred to the formset level.

MrF
 
Well I'll be!! That is certainly a kick in the head.

I appreciate all of you taking the time to educate me even though I don't much like the answer <g>.

Thanks to all for responding.

This is a great forum.

George
 
I don't know what kind property you are looking to add or how many but if it was just one and a string the I would use the TAG property. As to the other, I was thinking just a Public variable in the load event and a Release MyPublicVariable in the Destroy event would be almost like a property, but then I thought NO because you may have that form instantiated more than once and you may have other forms that have the same Public variable and I understand you want the form to take care of it's own, so then my last thought as I started typing this was a REGIONAL variable...since if it is duplicated then VFP will handle it for you.

Slighthaze = NULL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top