Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anchor for two editboxes
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01616840
Message ID:
01616917
Vues:
28
>>Thank you, Hugo. As I am sure you tried, your sample code works. So must be something weird in my form that caused the PageFrame to have this problem. I will not try in another window of the application.
>
>I do not know Dmitry, are you sure you start with all your anchors at zero before changing any size? Look at what would happen with a modified version of the previous code if you start the object anchors with a non-zero value:
>
>
>loForm				= createobject('myForm')
>loForm.show(1)
>
>define class myForm as form
>	height				= 480
>	add object myPageFrame as myPageFrame  with top =0, left = 0, width = 260, height = 460, anchor = 15
>
>	function init()
>		this.myPageFrame.Page1.newobject('myContainer', 'myContainer')
>		with this.myPageFrame.Page1.myContainer
>			.top					= 0
>			.left					= 0
>			.width					= 260
>			.height					= 460
>			.anchor					= 15
>			.myTopEditBox.Anchor	= 75
>			.myLabel.Anchor			= 80
>			.myBotEditBox.Anchor	= 30
>			.visible				= .t.
>		endwith
>	endfunc
>enddefine
>
>define class myContainer as container
>	backcolor	= rgb(0, 192, 192)
>	add object myTopEditBox as editbox with top = 3, width = 245, height = 200, left = 5, anchor = 75, backcolor = RGB(192, 192, 0)
>	add object myLabel as label with caption = 'This is some caption', top = 207, autosize = .t., backstyle = 0, anchor = 15
>	add object myBotEditBox as editbox with top = 225, width = 245, height = 200, left = 5, anchor = 30, backcolor = RGB(192, 0, 192)
>enddefine
>
>define class myPageFrame as pageframe
>	pagecount = 2
>enddefine
>
>
>Now put the anchors back to zero (in the add object of the class myContainer) and it will work fine, the issue was the changing of the dimensions of the parent container with anchor values already set (an thus tied to the original size).

Your examples work perfectly. But when I add two edit boxes to my forms (I tried at least two) and works sometimes and does not work, other times. I think the problem is either with something in my application. Or, I don't know what. I will keep trying.
Thank you very much for your help.
"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