Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anybody is using Anchor for Textboxes?
Message
 
 
À
13/12/2011 13:21:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01530880
Message ID:
01531013
Vues:
61
>>>>Hi,
>>>>
>>>>A while ago I have experimented a little with anchor property of text boxes and labels so that if a user increases the size of the window, these controls increase as well. At that time I didn't like the result. I wonder if anybody is using the anchor property for these controls and happy with the results?
>>>
>>>A sample:
>>>
>>>PUBLIC oform1
>>>
>>>oform1=NEWOBJECT("form1")
>>>oform1.Show
>>>RETURN
>>>
>>>DEFINE CLASS form1 AS form
>>>
>>>
>>>	Top = 0
>>>	Left = 0
>>>	Height = 32
>>>	Width = 146
>>>	DoCreate = .T.
>>>	Caption = "Form1"
>>>	Name = "Form1"
>>>
>>>
>>>	ADD OBJECT text1 AS textbox WITH ;
>>>		Anchor = 15, ;
>>>		Value = "Sample Text", ;
>>>		Left = 5, ;
>>>		Top = 5, ;
>>>		Width = 133, ;
>>>		Name = "Text1"
>>>
>>>
>>>	PROCEDURE text1.Move
>>>		LPARAMETERS nLeft, nTop, nWidth, nHeight
>>>		this.FontSize = MIN(MAX(INT(21*(m.nHeight/21)^0.5) - 12,4),127)
>>>	ENDPROC
>>>
>>>
>>>ENDDEFINE
>>>
>>
>>Thank you, Fabio. It looks nice when I tried your example. I suppose I would have to add the .Move method to the base class of my textbox, to make it work for all of them, right?
>
>Sure.
>"Move" is the event that VFP provides you to control the Anchor functionality
>With NODEF you can skip the Anchor effect

Thank you very much.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform