Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does my form not start maximized?
Message
 
 
To
09/03/2004 10:53:44
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00882789
Message ID:
00884505
Views:
21
I ran the code they provided to "duplicate the problem" and it worked. I couldn't get to duplicate in my app, though. I'm running with SCREEN = OFF AND RESOURCE = OFF in my config.fpw and neither _screen.visible = .F. or _vfp.visible = .F. stopped the "Report Designer" from appearing.

>Thanks Mike, but _screen.visible is .t. It got me to thinking though and I'm testing....
>
>
>>I found this in the Knowledgebase.
>>http://support.microsoft.com/default.aspx?scid=kb;en-us;156237
>>
>>
>>>VFP7 SP1 and VFP8 SP1. It works the same in both. I could trap for the error but since it doesn't do what I'm try to accomplish it is better to just remove the line period. The line is only there to attempt to maximize the print preview window. The goal is to have the preview form show maximized inside the VFP screen and have the horizontal bar visible and the toolbar docked. Right now the form is sized to maximized, the toolbar is docked, but the horizontal scrollbar is not visible because the form is not truly maximized. It is maximized until the toolbar is docked and then at some point after that it is no longer maximized but the size is still the maximized size.
>>>
>>>I actually do not run the code if the winodow is not there:
>>>
>>>IF WEXIST('Report Designer')
>>>	ZOOM WINDOW "Report Designer" MAX
>>>	MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Report Designer"
>>>	INKEY(.1)
>>>	MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Report Designer"
>>>ENDIF
>>>IF WEXIST('Print Preview')
>>>	MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview"
>>>ENDIF
>>>
>>>
>>>
>>>
>>>
>>>>What version of VFP are you using?
>>>>
>>>>All else fails you could trap and ignore the error.
>>>>
>>>>>Here is what is interesting. In my form's deactivate I now have the below code:
>>>>>
>>>>>
>>>>>DODEFAULT()
>>>>>ZOOM WINDOW "Report Designer" MAX && errors
>>>>>MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview" &&works to dock toolbar
>>>>>
>>>>>
>>>>>When the 'Report Designer' window is attempted to be maxed using the first line of code, it errors because 'Window REPORT DESIGNER' has not been defined.' Don't know why I don't have a report designer window..but anyway...
>>>>>At that point with my error message on my screen, I can visibly see the preview window in my form and it IS maximized. The horizontal scroll bar is also visible (my goal). However, the Print Preview Toolbar is still floating at this point.
>>>>>When the next line of code runs (MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview") the toolbar gets docked as it should, but then the window is no longer maximized. It is physically the size of being maximized, but it is actually normal at this point and the horizontal scroll bar is no longer visible.
>>>>>
>>>>>sheesh!
>>>>>
>>>>>
>>>>>>I take it back. When I tried to incorporate the code into my app - it broke.
>>>>>>In frmReport.Deactivate
>>>>>>
>>>>>>MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Report Designer"  && This line doesn't work
>>>>>>MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview"
>>>>>>
>>>>>>If I reverse them - neither works. They will both work if they are the only command. For now I have found that this code does the job.
>>>>>>
>>>>>>ZOOM WINDOW "Report Designer" MAX
>>>>>>MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview"
>>>>>>
>>>>>>I don't understand why you have no "Report Designer" - I can't get rid of it??? What version?
>>>>>>
>>>>>>>Still no luck. The window 'Report Designer' never exists at all at any point in time during the entire process. When I run the report with the code below in the form's deactivate, my caption is changed to 'Print Preview Window existed' and never changes to 'Report Designer window existed.' I've tried reversing the order, processing DODEFAULT() afterwards, etc to no avail. When I run the debugger and set a breakpoint on WEXIST('Report Designer') it never changes to .T. at all.
>>>>>>>
>>>>>>>
>>>>>>>DODEFAULT()
>>>>>>>IF WEXIST('Print Preview')
>>>>>>>	_screen.caption = "Print Preview window existed."
>>>>>>>	MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview"
>>>>>>>ENDIF
>>>>>>>IF WEXIST('Report Designer')
>>>>>>>	_screen.caption = "Report Designer window existed."
>>>>>>>	MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Report Designer"
>>>>>>>	INKEY(.1)
>>>>>>>	MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Report Designer"
>>>>>>>ENDIF
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Got it to work in the Deactivate event of the form used to IN WINDOW:
>>>>>>>>
MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Report Designer"
>>>>>>>>INKEY(.1)
>>>>>>>>MOUSE CLICK AT -0.1,0.1 WINDOW "Report Designer"
>>>>>>>>*You can also use
>>>>>>>>MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview"  && Dock the toolbar
>>>>>>>>
>>>>>>>>Seems to need a delay and some kind of extra click.
>>>>>>>>
>>>>>>>>>Thanks for the idea Mike, but the window 'Report Designer' never shows up as true with wexist(). The code never runs and if I don't encapsulate your code below within a WEXIST() statement it bombs because the window does not exist. I created a method on the form and called it from the end of the preview form's init. I tracked in the debugger for the existance of the window during the entire report process and it never changes to .t.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>Tracy,
>>>>>>>>>>Try (untested):
MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Report Designer"
You may have to call a custom method from the init to get this to work. This is the code I use to dock the toolbar.
>>>>>>>>>>
>>>>>>>>>>>Well, everything worked in testing using the example prg I posted. However, in my app, CTRL+F10 is reassigned (silly me, I forgot about that) so KEYBOARD... does not work. Also, it is a class so there is no Data Environment. I have to find another workaround it appears. Does any other keyboard combination have the same effect as the default CTRL+F10? ZOOM WINDOW ... I cannot use because I would have to add it to ALL reports...
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>>Guess I was confused as to which form you were having trouble with.
>>>>>>>>>>>>
>>>>>>>>>>>>If resources is on the KEYBOARD '{CTRL+F10}' will toggle.
>>>>>>>>>>>>
>>>>>>>>>>>>You can also put this code in the init of the DE of the report.
>>>>>>>>>>>>
ZOOM WINDOW "Report Designer" MAX
>>>>>>>>>>>>
>>>>>>>>>>>>>Iadded it to the init and it works great. Thanks Mel!
>>>>>>>>>>>>>
>>>>>>>>>>>>>Tracy
>>>>>>>>>>>>>
>>>>>>>>>>>>>>>Any ideas? <
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>I didn't test your code, but it seems like I KEYBOARD '{CTRL+F10}' to force a max preview report.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>Mel Cummings
Regards,

Mike

"We try to solve the problem by rushing through the design process so that enough time is left at the end to uncover the errors that were made because we rushed through the design process."
- Glenford Myers

If you're going through hell, keep going. - Walt Disney
Previous
Reply
Map
View

Click here to load this message in the networking platform