ST3VO
asked on
Position button to the right (like alRight)
Hi all,
I am having a problem trying to set the position of a button to be at the right.
I'm tried:
Button.Left := PageControl1.Width - Button.Width;
but it's not on the far right but about an inch from the far right.
I cannot use Align:=AlRight because the button goes to the right BUT it expands to the height of the form too so...what can I do please?
thx
st3vo
I am having a problem trying to set the position of a button to be at the right.
I'm tried:
Button.Left := PageControl1.Width - Button.Width;
but it's not on the far right but about an inch from the far right.
I cannot use Align:=AlRight because the button goes to the right BUT it expands to the height of the form too so...what can I do please?
thx
st3vo
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
change all anchors to false one by one and then set the width.
See which anchor gives you the problem.
Probably you need to set the anchor of right to false (set by default to true i thing).
Try it and post back.
See which anchor gives you the problem.
Probably you need to set the anchor of right to false (set by default to true i thing).
Try it and post back.
Sorry, change
Button1.Caption:=('X');
to
Button1.Caption:='X';
Button1.Caption:=('X');
to
Button1.Caption:='X';
ASKER
OK, I've tried all of them and none work 100%.
I'm not going to try: CodedK's change all anchors to false one by one and then set the width BUT the Button is created at runtime, so what's the syntax to set them to false?
I'm not going to try: CodedK's change all anchors to false one by one and then set the width BUT the Button is created at runtime, so what's the syntax to set them to false?
Maybe like this.....
Button1.Anchors := [akLeft, akBottom, akRight];
Button1.Anchors := [akLeft, akBottom, akRight];
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks all ! It wasn't just one thing that made it work ... it was a bit of all put together :o)
ASKER
The button is now quite big in width and I cannot change it anymore.
See code below...width is not working anymore, eventhough it's specified.
thx
Open in new window