Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does my form not start maximized?
Message
From
03/03/2004 12:47:58
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Why does my form not start maximized?
Miscellaneous
Thread ID:
00882789
Message ID:
00882789
Views:
73
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
.·*´¨)
.·`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"
Next
Reply
Map
View

Click here to load this message in the networking platform