Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling Code on Form Minimize and Maximize
Message
De
24/11/2007 08:48:41
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01271023
Message ID:
01271034
Vues:
23
>I need to run code whenever the minimize or maximize button is clicked as well as when the header bar is double-clicked, which also minimizes/maximizes it. Where does the code go?
>
>I was asked to create a test form for testing, and told that it's the resize event.
>
>To test this put a text box on the form and code in RESIZE:
>WITH thisform
> .text1.Value = STR(.height) + STR(.width)
>ENDWITH
>
>I created the test form with the text box and here is what I find:
>
>This does NOT work if
>FormWindowState = 0 and
>_ScreenWindowState = 2
>OR
>FormWindowState = 0 and
>_ScreenWindowState = 0
>
>It DOES work if
>FormWindowState = 2 and
>_ScreenWindowState = 0
>
>As a result I have inconsistant behavior...
>
>Primaraly, I'm having problems with resize code when switching between maximize (windowstate=2) and normal (windowstate=0) modes.
>
>I've added resize code in the activate, de-activate, and resize methods, and all I get is this inconsistant behavior...

Maybe this helps (VFP9):
Public oForm
oForm = Createobject('myForm')
oForm.Show

Define Class myForm As Form
	Add Object _txtHeight As TextBox With Top=10,Left=10,Value=Thisform.Height
	Add Object _txtwidth As TextBox With Top=40,Left=10,Value=Thisform.Width
	Add Object myHandler As myWHandler
	Procedure Init
		#Define WM_SIZE					0x0005
		Bindevent(This.HWnd,WM_SIZE,This.myHandler,'SizeChanged',4)
	Endproc

	Procedure SizeChanged
		This._txtHeight.Value = This.Height
		This._txtwidth.Value  = This.Width
	Endproc
Enddefine

Define Class myWHandler As wmBase Of ;
  "C:\Program Files\Microsoft Visual FoxPro 9\Samples\Solution\Europa\wmHandler.vcx"
	Procedure SizeChanged
		Lparameters HWnd As Integer, Msg As Integer, wParam As Integer, Lparam As Integer
		CallWindowProc(This.noldproc, HWnd, Msg, wParam, Lparam)
		Thisform.SizeChanged()
	Endproc
Enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform