04-06-2016 02:15 AM
Hello Guys,
First of all I would like to appreciate for immediate support you all are providing me by answering my queries. Hopefully I would like to contribute the same for this forum.
Coming to my query :), I have a scenario in which I would like to open my UI which has some controls. The labels on the controls are contained in an XML file. So as soon as I open my UI, the labels on the controls must get displayed from the XML file. I have already parsed the XML, the only thing I want to know is whether I could include a default XML file in the source code so that whenever a user opens the UI, all the labels of the controls gets published by reading the default XML.
Also, once working on the UI and making some changes in the labels manually in the GUI, these updates must get saved in the default file and when reopened again , appears with the changes last done.
Thanks a lot for your help.
Best Regards,
Raunak
04-07-2016 05:31 AM
Hi Raunak,
To meet your requirement you would need to use the GetCtrlAttribute & SetCtrlAttrbute functions to Read & Write the control label text.
I have mentioned below the functions help for your reference.
http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/uiref/cvisetctrlattribute/
http://zone.ni.com/reference/en-XX/help/370051T-01/cvi/uiref/cvigetctrlattribute/
And also set the control labels as soon as your code opens, you could set up a default XML file. You could also update this XML file just before closing the application to ensure your changes are reflected in the subsequent runs of the program.
Hope this helps.
Thanks & Regards,
Raghunandan N V
Applications Engineering.
NI-India.