How To Read & Write ValueBox Values To/From Script
I need to read and write values to/from ValueBox controls using results from within a script.
I tried pasting the simple example from the help tutorials/examples but I receive an error. I then tried the following without success:
float valueBox1Value = ValueBox1.Value?.Value;
I was able to write the value to a Labelx.Text after converting to text but I have exhausted options trying to write to a ValeuBox
5 replies
-
I know you said ValueBox but in case it would help, I think this is the syntax for Text Boxes:
TextBox2.Text=TextBox1.Text;
I'm not sure on ValueBoxes right off. I guess I haven't had a need to do that since in my case at least, I've only used value boxes that were set to display the value of a sourcetag or I've used the calculation option within the value box setup if I wanted to do something like take the value from a tag in one valuebox and do something with it.
The Canary Team might have better advice here but perhaps an example of what you are looking to do would also help.
-
I definitely could have something off here but here's what I used recently to set the value of ValueBox1 to 100 via a script:
string valueBoxName = "ValueBox1";
ControlValueBox valueBox = Screen.ScreenControls[valueBoxName] as ControlValueBox;
TVQ newValue = new TVQ(DateTime.Now, 100, 192);
valueBox.Value = newValue;