Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form Created with Define Window
Message
From
06/06/2018 16:35:51
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01660589
Message ID:
01660605
Views:
47
No, you only need to add two line of code, nothing more!

>I don't know, that is 1st. Secondly, I have a very large vertical application that would require many changes, in order to convert to the FoxyPreviewer. I hear only good things about FoxyPreviewer but I don't see, for far, the need to change.
>
>>Why don't you use FoxyPreviewer?
>>
>>>The CreateObject approach you describe maybe possible (although after you received C5, I would be concerned), but I don't want to change my code of DEFINE WINDOW since it has been working for a long time.
>>>Thank you.
>>>
>>>>After read others responses I thought that maybe you could use a actual Form object (via Define Class RepWindow as Form ) instead of a Define Window RepWindow. They should be the same to VFP. Does anyone else have anything to add to this approach?
>>>>
>>>>WAIT … I just tried this and am getting a C5 error on the REPORT FORM line
>>>>
>>>>
>>>>RepWindow=CREATEOBJECT("RepWindow")
>>>>RepWindow.show(2)
>>>>
>>>>REPORT FORM RepWindow TO PRINTER PROMPT PREVIEW WINDOW RepWindow
>>>>
>>>>RETURN
>>>>
>>>>DEFINE CLASS RepWindow as Form
>>>>	caption = 'RepWindow'
>>>>	windowstate = 2
>>>>*	visible = .t.
>>>>ENDDEFINE
>>>>
>>>>
>>>>>Hi,
>>>>>
>>>>>I have the following code in my application that creates a window in which a report is previewed. Here is the code:
>>>>>
>>>>>DEFINE WINDOW RepWindow ;
>>>>>   FROM 1, 1 TO 20, 20 ;
>>>>>   TITLE cReportTitle SYSTEM 
>>>>>
>>>>>ZOOM Window RepWindow  Max
>>>>>
>>>>>WAIT CLEAR 
>>>>>
>>>>>REPORT FORM (cReportFrxName) TO PRINTER PROMPT  PREVIEW WINDOW RepWindow
>>>>>
>>>>>RELEASE WINDOW RepWindow	
>>>>>
>>>>>
>>>>>While user is previewing the report (at the line REPORT FORM above), a code in another place of the application scans all open windows, as such:
>>>>>
>>>>>lnForms = _screen.formcount
>>>>>	 
>>>>>FOR i = lnForms to 1 STEP -1
>>>>>
>>>>>     *-- try to release this form:
>>>>>     _screen.Forms(i).Release
>>>>>
>>>>>ENDFOR
>>>>>
>>>>>
>>>>>But the _screen.formcount does not seem to include the form created with the DEFINE WINDOW (above).
>>>>>
>>>>>How can I either include the form created with DEFINE WINDOW in the _screen.formcount? Or how can I check if this form created with DEFINE WINDOW exists?
>>>>>
>>>>>TIA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform