How to use a text box for display only.

Support forum for MegunoLink
Joe
Posts: 24
Joined: Wed Jun 22, 2016 8:18 am

Tue Feb 20, 2018 9:03 pm

Hi all,

could someone please give me a short example how to change the text colour depending on a value? I can't really find an explanation in the manual.
In practical I'd show some voltage measurements and change the text colour if the voltage goes under a certain value.

Thanks for helping.

Joe
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Thu Feb 22, 2018 8:12 am

Hi Joe, for example

if (Temperature== 10) Panel.SetForeColor("MyTextbox", "Green");
else if (Temperature== 11)Panel.SetForeColor("MyTextbox", "Yellow");
else if (Temperature== 12) Panel.SetForeColor("MyTextbox", "Red");
else Panel.SetForeColor("MyTextbox", "Blue");

More commands are documented here
https://www.megunolink.com/documentatio ... r-library/

Cheers
Phil
Post Reply