I want to set TBitBtn
's anchor property dynamically.
First I have set the button's anchor as top right in design time. In that button click event I set form's BorderStyle
as bsDialog
. Then there should be a gap as shown in image. I want the button should be beside close button.
So I need to set button's left and its anchor as top right after assigning border style as bsDialog
. Is it correct?
I don't know the way to change anchor property dynamically
Thanks, Rakesh
In Delphi FireMonkey (XE4) to set anchors dynamically you do:
Button1.Anchors := [TAnchorKind.akTop, TAnchorKind.akRight];
I don't know if I can see your problem. If it's about syntax then here you go:
BitBtn1.Left:= 666;
BitBtn1.Anchors := [akTop, akRight];
This is the way to modify position and anchor in code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With