I'm perplexed.
This code works
Dim RadialGauge1 As RadialGauge = ugaugeNextRun.Gauges(0) Dim RadialScale1 As RadialGaugeScale = RadialGauge1.Scales(0) Dim RadialGaugeNeedle1 As RadialGaugeNeedle = RadialScale1.Markers(0)
This code fails
Dim RadialGaugeNeedle3 As RadialGaugeNeedle = ugaugeNextRun.Gauges(0).Scales(0).Markers(0)
What am I missing here? (I know this is probably going to be a facepalm moment but ...)
Hello ellswrth,
Could you please provide us more details or small sample that reproduce your issue. Lookig at the provide code, I`m not able to guess what is the reasons for your issue. I need to research your code. Please if you are able send us your sample and Ill be glad to take a look at your issue.
Regards
OK, this will reproduce the issue.
Create an empty project, then a form (Form1), then drop an UltraGauge on it.
In the dialog that opens when the UltraGauge is placed on the form, select the BasicClock preset. That will create three scales with one needle each.
Open the code behind the form and add this;
Imports Infragistics.UltraGauge.ResourcesPublic Class Form1 Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ' this code works fine Dim RadialGauge1 As RadialGauge = UltraGauge1.Gauges(0) Dim RadialScale1 As RadialGaugeScale = RadialGauge1.Scales(0) Dim RadialGaugeNeedle1 As RadialGaugeNeedle = RadialScale1.Markers(0) Dim RadialScale2 As RadialGaugeScale = RadialGauge1.Scales(1) Dim RadialGaugeNeedle2 As RadialGaugeNeedle = RadialScale2.Markers(0) Dim RadialScale3 As RadialGaugeScale = RadialGauge1.Scales(2) Dim RadialGaugeNeedle3 As RadialGaugeNeedle = RadialScale3.Markers(0) ' this code does not 'Dim RadialGaugeNeedle4 As RadialGaugeNeedle = UltraGauge1.Gauges(0).Scales(0).Markers(0) RadialGaugeNeedle1.Value = 3.5 RadialGaugeNeedle2.Value = 30 RadialGaugeNeedle3.Value = 37 End SubEnd Class
Now try the form. Clock will display 03:30:37.
Next, comment out all the code between ' this code works fine and 'this code does not, and uncomment the line after 'this code does not.
Error appears saying
'Scales' is not a member of 'Infragistics.UltraGauge.Resources.Gauge'
Reminder that I said this is probably me overlooking something obvious.
Here is the sample
Thanks for provided code. I was able to reproduce your issue. You just missed to cast your object to RadialGauge. For example:
RadialGaugeNeedle RadialGaugeNeedle4 = ((RadialGauge)ultraGauge1.Gauges[0]).Scales[0].Markers[0] as RadialGaugeNeedle;
Please take a look at the attached sample and video file for more details.