Hi guys. Is there a way to bypass Locking? In Xcode locking can be top and bottom vs Xojo forced side locking.
How can I lock my TextArea or any other objects to top and bottom only? Is this possible with code?
c.LockLeft = false
c.LockRight = false
you can turn it off always.
Then left and right are on your own.
RectControls in desktop have 4 boolean lock properties, one for each side, which you can set however you want.
The default is for right and top to be true and the others false.
-Karen
Thanksā¦ I inserted the below but it is still locking to the left. The top and bottom are fine tho
EditingField.LockRight = False
EditingField.LockLeft = False
EditingField.LockTop = True
EditingField.LockBottom = True
Im kinda half-way there. Still one side is locking when using āFalseā
What are you expecting to happen if all are turned off?
Iām trying to achieve: only top and bottom locked (similar to how it is done using xcode)
OK, but if left isnt locked, what do you imagine will happen to the left position if the parent is resized?
The only effect āleft locked = falseā has, is to allow a control to move right IF and only if right locked = true
We do that, and then assign left in Resize event of Window to keep control centered.
I believe it should be more simpler to allow more free locking like (top and bottom only) for apps with left and right panels and a center view. Iām working around possibilities of building an app for students like myself with a text area at the center with left and right controls. The TextArea Iād prefer to stay in position (top and bottom), similar to MS Word and Apple Pages. Not every app idea should be forced to lock to either left or right.
Itās kinda restricting, unless thereās a way and Iām doing it wrong.
It seems to me that the issue may be the order in which you are doing it. Have you tried locking the ones you want first and then unlocking the ones you donāt.
Yes, thanks. I placed the top and bottom in 1st and 2nd but it is still locked to the left
Leave it locked left and in the Resizing event, do this:
TextArea1.Left = (Self.Width - TextArea1.Width) / 2
My bad, I missed the top/bottom only request. The suggestion from Christian and Greg are the way to go. It seems you are looking for a grid-based layout.
Thank you very muchā¦ Just have to find the right width since ā2ā is too small
2 isnāt the width. Youāre dividing the remaining space in half so the control appears centered on the window.
Oh, Thanks again. I got it done as wanted.