How to access or set a value of a slider (or other elements) of my gauge

To get access to properties of a gauge elements it is necessary to take advantage of the GetByName function of a gauge and then cast the result to the required element type:

var element = widget1.Instrument.GetByName("<Element Name>"as <ElementType>;

element.Property = newValue;

This way you can get access to any properties of any gauge elements.

For example to change values of the slider (Slider1) we can use the following code:

var slider = widget1.Instrument.GetByName("Slider1"as PerpetuumSoft.Instrumentation.Model.Slider;
slider.Value = 20;

Or, for example to change the displayed text and its color with the DigitalText element:

var digitalText = widget1.Instrument.GetByName("DigitalText1"as PerpetuumSoft.Instrumentation.Model.Specialized.DigitalText;
digitalText.Text = "Hello!";
digitalText.ActiveColor = Color.LightGreen;
Please note that if you need to manipulate properties of just a single slider you would probably better use the InstrumentWidget control. See an article about difference between widget and instrumentation widget controls.

Add Feedback