Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid anchor
Message
From
02/06/2015 11:10:17
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01620451
Message ID:
01620498
Views:
55
>>>Hi,
>>>
>>>I need help in finding the anchor value for a grid. The grid should grow both horizontally and vertically. But when it grows horizontally, it should maintain fix distance with the object to the right. Here is what works:
>>>Value 130 does the job as far as horizontal resizing. That is, the grid expands horizontally but stays at fixed distance with the object to the right (container). But it does not expand vertically.
>>>When I set the value to 15, the grid expands both horizontally and vertically but the the right edge of the grids goes over the object to the right.
>>
>>135 - Just double click the anchor property in the properties editor, it will give you a graphic representation of the value.
>
>Thank you. Yes, 135 works. I know that once I have the correct number I can view the representation in the property editor. The problem is that I could not figure how to arrive at this number, 135. Still don't.

Hugo gave you easy way -- simply do it graphically. You double-click on the Anchor property to bring up the Anchor Editor, then you can graphically configure by clicking on the "bars" surrounding the object -- the "bars" cycle through values of "absolute" (gray), "relative" (black) and "none" (unfilled). The value for the anchor is displayed, as well as description.

The "hard" way (or the way someone who tends to think in low-level -- e.g. using C or assembler -- is apt to view things) is to compute the value by combining bitmask values (see help topic on Anchor property):
1 - absolute top ( 0000 0001 in binary )
2 - absolute left ( 0000 0010 in binary )
4 - absolute bottom ( 0000 0100 in binary )
8 - absolute right ( 00001 000 in binary )
16 - relative top ( 0001 0000 in binary )
32 - relative left ( 0010 0000 in binary )
64 - relative bottom ( 0100 0000 in binary )
128 - relative right ( 1000 0000 in binary )
256 - Horizontal fixed size ( 0001 0000 0000 in binary )
512 - Vertical fixed size ( 0010 0000 0000 in binary )
so to compute the value you were looking for in your original post:
(absolute top) + (absolute left) + (relative right) + (absolute bottom) = 1 + 2 + 128 + 4 = 135
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform