Linking a global structure member to a control

Hi All, I am not sure if what i am looking for is possible or not so I will try to explain as best as i can.
I have a serial class which reads data from a CAN bus, this data is used to populate a structure which basically contains a list of all the variables I am reading. eg Structure.rpm = the rpm, Structure.temp = temperature and so on.
The serial class just populates the structure with all of the received information.

Then I have lots of controls - edit boxes, labels etc which are updated depending on what data is recieved.

This is all working well, however in the reception routine I set the structure data fields depending on what was received and then i also update the text fields in the labels and edit boxes etc. this is great till i want to change something, then it gets a little messy.

Is there a way to have the control automatically update when the value in the global structure changes.

eg if structure.rpm’s data value is changed then the change is also shown in rpmTextField.Text

Thanks

You would need to do that yourself.

I thought of figured that would be the case, I do not even know where to begin to do this, is there an event or something that fires for every control to determine if repaint is needed that i can tap into to set the value or something similar? Or how would you do this, Ultimately I would then link a reference to the data to each control and it could then update itself if the value inside the reference has changed.

You could have a timer which picks up all the values when it fires.

Or instead of a structure, have properties which are computed variables.
Update the controls in the ‘Set’ method.

may create a class with name,value and output object property.
then use a list/array for this.
having a method Update(“rpm”, 3600)
look if newValue<>value then value=newValue, obj.Text=value.ToString

I would use class ( or a global module) instead of a structure
the class has methods, setrpm, settemp, etc…
(or even a setvalue method with a parameter that indicates which value is set)
each controlitem must register itself on the class above at the window opening
this way the class maintains a list of controlitems to update
each time a set method is called.