0

I have a FireMonkey FMX TForm in Delphi 10.2 with many TSpinBoxes. For each TSpinBox I add a corresponding property to the TForm.

I want to link each TSpinBox to the corresponding TForm property so that changing the value of a TSpinBox automatically updates the corresponding TForm property and vice versa.

In the past I did this by using an OnChange event handler for each TSpinBox to update the corresponding TForm property and the property's setter method to update the TSpinBox value.

Because I have many TSpinBoxes this is now becoming very cumbersome. Is there a better, more efficient way to do this?

1
  • 3
    It is hard for me to give much useful suggestion because since you haven't shown any code I can just guess of what you are doing. But since you appear to be working with many components of same type you might want to learn on how share one common event handler between multiple components (using Sender to determine which component fired the event). Or perhaps how indexed properties work. It might allow you to have a single property for updating state of any of your SpinBoxes. Without seeing pat of your existing code all we can do is just guess. And her on SO such questions are not wanted. Oct 1 at 21:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.