Hi James,
_SCREEN should always be there, (although its probably hidden), so Sergey's idea should work.
_screen.width is giving the screens width NOT your forms, if you want the form use _SCREEN.OTlfName.width
hth
>Sergey,
>
>Thanks for your prompt reply. I'll try this out. But I thought _SCREEN was only available to apps designed with SHOWWINDOW=0 ?
>Also, if _SCREEN.width returned the incorrect value, wouldn't _SCREEN.OTlfName.width give me the same?
>Give me a sec, and I'll try it.
>
>>James,
>>
>>What about adding following code to the init of top level form?
>>
>>_SCREEN.AddProperty("oTFLName", THISFORM)
>>
>>After that you can reference it as _SCREEN.oTflName
>>
>>>Hope someone can help me here. I know enough to be dangerous, as they say. Here's my question:
>>>
>>>I'm taking my first stab at a top level form application, rather than the "In Screen (Default)" type. I'm playing around with dynamically resizing (the file examples and the Jan 99 issue of FoxproAdvisor were very helpful, thanks). I'm trying to find the right command for determining the name of the top level form, from within the application. I tried using _SCREEN, _VFP, and APPLICATION, but no joy. So far, I'm able to get it by using the following code:
>>>
>>>
>>>FOR EACH oForm IN APPLICATION.FORMS
>>> IF oForm.ShowWindow = 2
>>> oTLFName=oForm
>>> EXIT
>>> ENDIF
>>>ENDFOR
>>>
>>>IF TYPE("oTLFName")="O"
>>> * I can now refer to it's properties, i.e., oTLFName.Height
>>>ELSE
>>> * ShowWindow property is set to either 0 or 1
>>>ENDIF
>>>
>>>
>>>Is there a cleaner method of accessing TLF properties? I know that I could simply hard code the name, but I would like to create a class from this, if feasible. Thanks in advance...
Roi
'MCP' Visual FoxPro
In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!