Report post

Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.

Users reporting for no reason may be locked out.


Post

Posted by Nick Thissen
on
Reading a value from a Label is easy if you have the reference to that Label, just grab the DisplayText property (and convert it to a number if you need it as a number):
var text = label.DisplayText;
var number = int.Parse(text);


The difficult part may be where to get the "label" object reference. If it's a static label in a static Widget in your theme, it's easy, just call it by name via its parents:
var theme = item.Theme;
var label = theme.Widgets.Find("MyWidget1").SubWidgets.Find("MySubWidget2").Labels.Find("TargetLabelName");


If it's a label in a Ticker it is more difficult. In that case it's probably easier to grab the reference to the Spreadsheet object (either the source file itself or if you've added it to the Theme you can get the Spreadsheet theme item).