Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does my form not start maximized?
Message
From
05/03/2004 17:03:19
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00882789
Message ID:
00883704
Views:
15
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
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform