General information
Category:
Forms & Form designer
>I think you and others have one thing wrong in your understanding of anchoring:
>if you programmatically set some left,top, height or width value, these values are not recalculated by the current Anchor setting of the control, but taken as they are. The Anchor setting only effects the values computed due to a form resize or a resize of the container containing the control.
Right. That's why I asked the question in the first place. What I wanted to do was set up assign methods for Left, Top, Height and Width that could figure out on their own whether to reset Anchor to recognize the new position or now.
>So if you modify the anchor setting within some left, top, height or width assign it's already too late, the value passed in is already computed regarding the anchor value, setting the Anchor to 0 does not change the value of the parameter.
In my testing, this wasn't an issue, but maybe that's because I was trying to do it from the other side. That is, my goal was to recognize the interactive resize and leave anchoring there, but reset it on programmatic changes.
Doing it that way, the code that makes programmatic changes wouldn't have needed anything special. That said, I've found no way to reliably identify the end of an interative resize, so gone back to resetting Anchor manually every time I have a programmatic resize/reposition.
Tamar
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only