Hello newsgroup.

I have a form that I created and I am running it directly
from the IDE. I am using VFP 8.0

It has a PageFrame and a Text Box. I have a database
also associated with in.

I am trying trying to set a property on one of textbox at
runtime.

When I run the form I get an error.

frmItem.pgfMaint.pagSearch.txtItem.fontsize = "9"

I get an error saying that frmItem object is not found.

Am I missing something?

Thanks,
Daniel

Re: Newbie Question by Cindy

Cindy
Sun Nov 30 16:45:25 CST 2003

In news: 01e701c3b791$a75aea00$a401280a@phx.gbl,
Daniel V <anonymous@discussions.microsoft.com> wrote:
> I have a form that I created and I am running it directly
> from the IDE. I am using VFP 8.0
>
> It has a PageFrame and a Text Box. I have a database
> also associated with in.
>
> I am trying trying to set a property on one of textbox at
> runtime.
>
> When I run the form I get an error.
>
> frmItem.pgfMaint.pagSearch.txtItem.fontsize = "9"
>
> I get an error saying that frmItem object is not found.

Hi Daniel,

Where is the line of code you're running? Try

*!* In txtItem's method code, such as txtItem.Init()
This.FontSize = 9
*!* Anywhere in the form
ThisForm.pgfMaint.pagSearch.txtItem.fontsize = "9"

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@mvps.org www.cindywinegarden.com




Re: Newbie Question by anonymous

anonymous
Sun Nov 30 17:03:07 CST 2003

Hi Cindy

Thanks for the quick response, I had something like that
in waiting for a response. I put in in the load event of
the form, now I get error

unknown member pgfMaint

Thanks,
Daniel


>-----Original Message-----
>In news: 01e701c3b791$a75aea00$a401280a@phx.gbl,
>Daniel V <anonymous@discussions.microsoft.com> wrote:
>> I have a form that I created and I am running it
directly
>> from the IDE. I am using VFP 8.0
>>
>> It has a PageFrame and a Text Box. I have a database
>> also associated with in.
>>
>> I am trying trying to set a property on one of textbox
at
>> runtime.
>>
>> When I run the form I get an error.
>>
>> frmItem.pgfMaint.pagSearch.txtItem.fontsize = "9"
>>
>> I get an error saying that frmItem object is not found.
>
>Hi Daniel,
>
>Where is the line of code you're running? Try
>
>*!* In txtItem's method code, such as txtItem.Init()
>This.FontSize = 9
>*!* Anywhere in the form
>ThisForm.pgfMaint.pagSearch.txtItem.fontsize = "9"
>
>--
>Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
>cindy.winegarden@mvps.org www.cindywinegarden.com
>
>
>
>.
>

Re: Newbie Question by brian

brian
Sun Nov 30 17:35:47 CST 2003

You can't reference form objects in the Load Event. Only
form properties.
Do it in the Init Event
Brian
>-----Original Message-----
>Hi Cindy
>
>Thanks for the quick response, I had something like that
>in waiting for a response. I put in in the load event of
>the form, now I get error
>
>unknown member pgfMaint
>
>Thanks,
>Daniel
>
>
>>-----Original Message-----
>>In news: 01e701c3b791$a75aea00$a401280a@phx.gbl,
>>Daniel V <anonymous@discussions.microsoft.com> wrote:
>>> I have a form that I created and I am running it
>directly
>>> from the IDE. I am using VFP 8.0
>>>
>>> It has a PageFrame and a Text Box. I have a database
>>> also associated with in.
>>>
>>> I am trying trying to set a property on one of textbox
>at
>>> runtime.
>>>
>>> When I run the form I get an error.
>>>
>>> frmItem.pgfMaint.pagSearch.txtItem.fontsize = "9"
>>>
>>> I get an error saying that frmItem object is not found.
>>
>>Hi Daniel,
>>
>>Where is the line of code you're running? Try
>>
>>*!* In txtItem's method code, such as txtItem.Init()
>>This.FontSize = 9
>>*!* Anywhere in the form
>>ThisForm.pgfMaint.pagSearch.txtItem.fontsize = "9"
>>
>>--
>>Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
>>cindy.winegarden@mvps.org www.cindywinegarden.com
>>
>>
>>
>>.
>>
>.
>

Re: Newbie Question by Cindy

Cindy
Sun Nov 30 17:46:24 CST 2003

In news: 01f001c3b796$1e09c500$a501280a@phx.gbl,
anonymous@discussions.microsoft.com <anonymous@discussions.microsoft.com>
wrote:
> ... I put in in the load event of
> the form, now I get error
>
> unknown member pgfMaint

Here's how a VFP form comes into being - first Load() then Init(). Init
happens "from the inside out" so the Form will begin to Init(), then the
PageFrame, then the Page, then the controls on the page. When the controls
are done the Page will finish its Init(), then the PageFrame, then the Form.
The controls, for example your text boxes, don't really exist until they
finish their Init(). Code in these methods runs "on the way out" not "on the
way in."

I should have qualified my "anywhere in the form" to say that it would only
work when the form was fully instantiated.

Will it work for you if you put the code in the Init() of the text box
itself?

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@mvps.org www.cindywinegarden.com