Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: mohammed qasem
  Where is mohammed qasem?
 amman
 Jordan
 mohammed qasem
 Tags
Subject: RE: center
Thread ID: 209400 Message ID: 209407 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Sunday, December 28, 2008 1:28:22 PM         
   


> hi all,
>
> i need help to show the mean form at the center of desktop for any ps,
>
> screen size is 14,17,19,21...etc
>

You can use form.AutoCenter. If you want to update the form position on _screen.Resize, you can use BindEvent():

LOCAL oForm as Form
oForm = CREATEOBJECT('TestForm')
oForm.Show(1)
RETURN

DEFINE CLASS TestForm as Form
	AutoCenter = .T.
	PROCEDURE Init
		BINDEVENT(_screen,'Resize', This, 'AutoResize')
	ENDPROC
	PROCEDURE Destroy
		UNBINDEVENTS(This)
	ENDPROC
	PROCEDURE AutoResize
		This.AutoCenter = This.AutoCenter
	ENDPROC
ENDDEFINE




hth
-Stefan

ENTIRE THREAD

center Posted by mohammed qasem @ 12/28/2008 11:51:39 AM
RE: center Posted by Stefan Wuebbe @ 12/28/2008 1:28:22 PM
RE: center Posted by mohammed qasem @ 12/28/2008 1:42:41 PM
RE: center Posted by Stefan Wuebbe @ 12/28/2008 1:48:55 PM
RE: center Posted by mohammed qasem @ 12/28/2008 2:00:18 PM
RE: center Posted by Stefan Wuebbe @ 12/28/2008 2:14:07 PM