Programmatically changing text of a UI control
Print Topic | Close Window

By Maisy Kay - 3 Years Ago
Hey Guys, 

I've only started using Nevron today and I'm finding it impossible to change the text for UI elements during run time. I noticed that NButton inherits some modifiers from the built in UI controls that come in .net but for example if I try the following:

myButton.Text = "foo";

No changes are being displayed. Can someone tell me how I am to implement the programmatic change of text during runtime.

By Nevron Support - 3 Years Ago
Hi Maisy,

In order to apply text to a NOV button you need to use:

nButtonControl1.Content = new NLabel("Hello World");

This is required as in NOV buttons can host any widget - for example image, image and text etc. 
We hope this helps - let us know if you meet any problems or have any questions.