Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking 2 components together? 1

Status
Not open for further replies.

pierrotsc

Programmer
Nov 25, 2007
358
US
Let me explain what i am trying to do:
I have a spin edit component. When i increase or decrease its value, i would like it to update a display. I am not sure if the display should be made with labels or textedit.

That means, if i have a 5 displayed in the spinedit, i would like my display automatically show 5,4.5,4,3.5...
The first value is the spinedit value. all the other values are the spinedit value * a coefficient.
All the values in the display should be read only. the only value that change is in the spinedit.
I hope i am making sense. I am sure i could code the onchange event in the spinedit to update the label or textedit but wonder if there's something built-in.
Thanks.
Pierrotsc
 
Usually spin edit controls have an event that triggers when the user presses the up or down button. Use that.
 
Yep, that is what I am doing. I was just checking if nothing else (more automatic) existed.
Thanks for the reply.
 
Oops - I thought you were using a different event.

You could make the value a propery of the form (or create your own object). When the spin edit value changes you update the value of the property and its code can update the edit boxes. In theory you could make the code search through the components on the form and update them automatically. Then you could add new edit boxes and your code would require very little adjustment.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top