Recent

Author Topic: Keeping two buttons physically together  (Read 4183 times)

Elmug

  • Hero Member
  • *****
  • Posts: 849
Keeping two buttons physically together
« on: July 19, 2011, 04:08:26 am »
I want to keep two buttons physically one next to the other, yet they still keep independent properties.

I thought I could put them in a panel, a TPanel, in fact, but wonder if there's a better way.

So, when I move them they move together, and if I want to make clones of the pair, it's less work and consistent results.

Thanks!

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: Keeping two buttons physically together
« Reply #1 on: July 19, 2011, 04:10:20 am »
Explore the buttons Anchors properties.  This can be used to tie two objects to each other.

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: Keeping two buttons physically together
« Reply #2 on: July 19, 2011, 01:54:00 pm »
Explore the buttons Anchors properties.  This can be used to tie two objects to each other.

I'll look into that..Thanks IPguy!!

mas steindorff

  • Hero Member
  • *****
  • Posts: 566
Re: Keeping two buttons physically together
« Reply #3 on: July 19, 2011, 07:38:23 pm »
you can also use the onclick operation of a timage and do the mouse position math yourself to get down to a pical separation.  I don't have an example but this forum has covered the how to several times.
windows 10 &11, Ubuntu 21+ IDE 3.4 general releases

eny

  • Hero Member
  • *****
  • Posts: 1659
Re: Keeping two buttons physically together
« Reply #4 on: July 19, 2011, 10:05:44 pm »
You could create a Frame and put the buttons on there, aligned to the frame with border spacing set to what you want.
All posts based on: Win11; Lazarus 4_4  (x64) 12-02-2026 (unless specified otherwise...)

 

TinyPortal © 2005-2018