Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does my form not start maximized?
Message
From
03/03/2004 13:16:40
 
 
To
03/03/2004 12:47:58
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00882789
Message ID:
00882802
Views:
18
You can also also do this...


DEFINE CLASS previewform AS form

desktop = .T. <----- Add this
Top = 0
Left = 0
Height = 250
Width = 375
ScrollBars = 3
DoCreate = .T.
Caption = "Print Preview Window"
WindowState = 2
setstatus = "''"
Name = "previewform"


>I display a report in a form. The placement of the toolbar works great. The only problem is that I cannot get the form to display maximized initially so the horizontal scrollbar will be visible. I only see the vertical scrollbar because the form is not maximized. If when the report displays I click on the maximize button then the form maximizes and the horizontal scrollbar becomes visible.
>
>Any ideas? You can test using the code below if once you create the table testit in code you also create a short, quick report named 'testit.' I set the screen height and width to mimic the problem I am having and the screen settings in my app.
>
>
>SET SAFETY OFF
>IF WEXIST('STANDARD')
>	HIDE WINDOW STANDARD
>ENDIF
>
>_screen.width=720
>_screen.height=460
>
>CREATE TABLE testit (cid c(10))
>SELE testit
>FOR i = 1 TO 100
>	APPEND BLANK
>	REPLACE testit.cid WITH ALLTRIM(STR(i))
>ENDFOR
>
>*--Create a simple report name testit so you can run this part
>m.reportform = 'testit'
>
>LOCAL oPreviewForm
>oPreviewForm = NEWOBJECT('PreviewForm')
>
>REPORT FORM (m.reportform) WINDOW PREVIEWFORM PREVIEW
>
>oPreviewForm.Release
>
>USE IN testit
>
>RETURN
>
>
>DEFINE CLASS previewform AS form
>
>
>	Top = 0
>	Left = 0
>	Height = 250
>	Width = 375
>	ScrollBars = 3
>	DoCreate = .T.
>	Caption = "Print Preview Window"
>	WindowState = 2
>	setstatus = "''"
>	Name = "previewform"
>
>
>	PROCEDURE GotFocus
>		this.windowstate = 2
>		DODEFAULT()
>	ENDPROC
>
>
>	PROCEDURE Deactivate
>		MOUSE DBLCLICK AT -0.1,0.1 WINDOW "Print Preview"
>		DODEFAULT()
>	ENDPROC
>
>
>	PROCEDURE Init
>		thisform.setstatus = SET('STATUS BAR')
>		set status bar on
>		DODEFAULT()
>		this.show()
>	ENDPROC
>
>
>	PROCEDURE Show
>		LPARAMETERS nStyle
>		this.windowstate = 2
>		DODEFAULT()
>	ENDPROC
>
>
>	PROCEDURE Release
>		IF !EMPTY(thisform.setstatus)
>			PRIVATE lcstatusbar
>			lcstatusbar = THISFORM.setstatus
>			SET STATUS BAR &lcstatusbar
>		ENDIF
>		DODEFAULT()
>	ENDPROC
>
>
>	PROCEDURE QueryUnload
>		IF !EMPTY(thisform.setstatus)
>			PRIVATE lcstatusbar
>			lcstatusbar = THISFORM.setstatus
>			SET STATUS BAR &lcstatusbar
>		ENDIF
>		DODEFAULT()
>	ENDPROC
>
>
>ENDDEFINE
>
Previous
Reply
Map
View

Click here to load this message in the networking platform