Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form Maximize Problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01026217
Message ID:
01026271
Vues:
19
Franco,

I'm not seeing the problem you're reporting in either VFP8SP1 or VFP9. Here's some code to show how I tested it. Just run this code and click the Grow button. A second form will appear and maximize. I have 3 lines commented out. Uncomment one of them and run it again. Do that for each line. You should see that the second form maximizes in each case. What *may* be causing your problems is the possibility of class code firing in the setfocus that stops the form from resizing.
LOCAL loForm AS frmMaximize

loForm = NEWOBJECT('frmMaximize')
loForm.Show()
READ EVENTS

loForm = null


DEFINE CLASS frmMaximize AS Form
	oForm = null

	ADD OBJECT cmdMax AS CommandButton WITH ;
			Top = 10, ;
			Left = 10, ;
			Height = 27, ;
			Caption = 'Grow'

	PROCEDURE cmdMax.Click
		thisform.oForm = NEWOBJECT('frmMaximize2')
		WITH thisform.oForm
			.AutoCenter = .t.
			.Show()
			.WindowState = 2
			*JCJB*	Uncomment one of the following lines at a time.
			*.txtTest.SetFocus()
			*this.SetFocus()
			*.Activate()
		ENDWITH
	ENDPROC

	PROCEDURE Destroy
		this.oForm = null
		CLEAR EVENTS
	ENDPROC
ENDDEFINE

DEFINE CLASS frmMaximize2 AS Form
	ADD OBJECT txtTest AS TextBox
ENDDEFINE
HTH,
Chad


>Hi
>
>I'm having a problem with maximising a form.
>
>If I setfocus() after setting windowstate = 2, the form does not maximize.
>
>If I comment the setfocus() code, it works fine.
>
>Do you know why this happens ? and how to overcome it maybe ?
>
>Thanks.
_________________________________
There are 2 types of people in the world:
    Those who need closure
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform