Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fading Out Visual Foxpro Form Control
Message
De
23/03/2011 15:16:26
 
 
À
23/03/2011 14:32:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01504655
Message ID:
01504726
Vues:
128
>HI Anatoliy
>
>Sounds a bit like an animated gif...... I tried that by creating 2 images, 1 animated the other the initial state of the image then within the click event I swapped out the initial for the amimated but I ran into trouble controlling the refresh. The gif was supported to loop only once but it did a couple of times and as well I ran into trouble handling what's displayed within the gif (listbox, labels etc) when shrinking it.
>
>Would definitely slicken up a VFP form to have controls shrink or fade.
>
>
>Don

Just something I threw together...
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 36, ;
		Left = 48, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Command1", ;
		Name = "Command1"


	ADD OBJECT command2 AS commandbutton WITH ;
		Top = 72, ;
		Left = 48, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Command2", ;
		Name = "Command2"


	PROCEDURE shrink
		LPARAMETERS toObj

		DECLARE INTEGER Sleep IN WIN32API INTEGER

		t = toObj.top
		l = toObj.left
		h = toObj.height 
		w = toObj.width

		#define kRate 10

		dw = w/kRate 
		dh = h/kRate 

		WITH toObj
			FOR i=kRate TO 0 STEP -1
				.top = .Top + dh
				.left = .left + dw
				.height = MAX(0, .height - (dh*2))
				.width = MAX(0, .width - (dw*2))
				.refresh
				sleep(200)
			NEXT 
			.visible = .f.
                                                                 * reset for when it is made visible again.
			.top = t
			.left = l
			.height = h
			.width = w
		ENDWITH 
	ENDPROC


	PROCEDURE command1.Click
		thisform.command2.Visible = .t.
		thisform.shrink(this)
	ENDPROC


	PROCEDURE command2.Click
		thisform.command1.Visible = .t.
		thisform.shrink(this)
	ENDPROC


ENDDEFINE
Greg Reichert
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform