Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Anchor for two editboxes
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01616840
Message ID:
01616872
Views:
36
>>Exactly. And your example works in a small .prg file. Thank you.
>>
>>But when I set the value of my edit boxes to the same values as you have, it does not work. The issue must be that my edit boxes are in a container which is inside a page of a pageframe. And I set the anchor values in the INIT method of the form. Could it be that the anchor value of the PageFrame or the container is causing the problem?
>
>
>Are you changing width/height or the edit boxes before changing the anchor? This might be a problem, if you are doing something like that, first you need to set the anchor to zero, then adjust width/height and then set the anchor to whatever value you need.
>
>I do not think that having the edit boxes in containers should make a difference:
>
>
>loForm			= CREATEOBJECT('myForm')
>loForm.Show(1)
>
>DEFINE CLASS myForm as Form
>	height = 450
>	ADD OBJECT myContainer as myContainer WITH top =0, left = 0, width = 220, height = 420, anchor = 15
>ENDDEFINE
>
>DEFINE CLASS myContainer as Container
>	ADD OBJECT myTopEditBox as EditBox WITH top = 5, width = 200, height = 200, left = 5, anchor = 75
>	ADD OBJECT myBotEditBox as EditBox WITH top = 210, width = 200, height = 200, left = 5, anchor = 30	
>enddefine
>
First, thank you.

Here is what I do in my INIT method of the form.

1. Dynamically add container to the form (where the edit boxes reside). The snippet of the code is as follows:
	thisform.pageframe1.page1.AddObject( "fields_container", "fields_container" )
2. Dynamically add a container (not related to the edit boxes) on the top of the form and adjust the height of the form and .top value of all controls.
3. Set the anchor value of the edit boxes according to your suggestions.

I probably need to set the anchor values before step 2 (before adding another container and re-sizing the form).
"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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform