I try to control the value and when changing it, update the text field after performing some calculations with the result.
The value I'm trying to control comes from a property AGauge(custom control). I want to update the text box when changing AGauge.Value.
I covered issues like This One , but I really don't understand how it works, or what I need to change to get the result. m looking for.
Could someone better explain what I need to do to make this work?
AGuage.Value- this is the type float, you may be surprised.
Thanks in advance.
Update 1
Now I have added the following code to my project:
public class AGuage
{
private float _value;
public float Value
{
get
{
return this._value;
}
set
{
this._value = value;
this.ValueChanged(this._value);
}
}
public void ValueChanged(float newValue)
{
}
}
And you can start ValueChangedusing the following:
AGuage n = new AGuage();
n.Value = Pressure_Gauge.Value;
Pressure_Gauge.Value.
, , , - :
public void ValueChanged(float newValue)
{
Form1.Pressure_Raw.text = "Working";
}
form1 , : An object reference is required for the nonstatic field, method, or property.
, , Static, ?
.