Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Favorite Enhancement
Message
 
 
À
09/06/2004 13:09:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00910115
Message ID:
00912076
Vues:
38
Fabio,

Your test is not an accurate test of anchor at all because of this code:

>
>	PROCEDURE Label1.Click
>		this.Top = 0
>	ENDPROC
>
That fundamentally invalidates it. Please read the example in the help file.

This form on the other hand proves the equivalence of 0, 1, 2 and 3. Resize the form as much as you please and you'll find that each of the 4 labels always remain in the exact same place on top of each other.
PUBLIC oform1

oform1=CREATEOBJECT("form1")
oform1.Show

**************************************************
*-- Form:         form1 (c:\vfp9app\misc\proveanchoreqivalence.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   06/09/04 10:26:13 PM
*
DEFINE CLASS form1 AS form


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


	ADD OBJECT label1 AS label WITH ;
		BackStyle = 0, ;
		Caption = "Label1", ;
		Height = 17, ;
		Left = 36, ;
		Top = 23, ;
		Width = 40, ;
		Name = "Label1"


	ADD OBJECT label2 AS label WITH ;
		Anchor = 1, ;
		BackStyle = 0, ;
		Caption = "Label1", ;
		Height = 17, ;
		Left = 36, ;
		Top = 23, ;
		Width = 40, ;
		Name = "Label2"


	ADD OBJECT label3 AS label WITH ;
		Anchor = 2, ;
		BackStyle = 0, ;
		Caption = "Label1", ;
		Height = 17, ;
		Left = 36, ;
		Top = 23, ;
		Width = 40, ;
		Name = "Label3"


	ADD OBJECT label4 AS label WITH ;
		Anchor = 3, ;
		BackStyle = 0, ;
		Caption = "Label1", ;
		Height = 17, ;
		Left = 36, ;
		Top = 23, ;
		Width = 40, ;
		Name = "Label4"


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform