11-05-2012 01:26 PM
Hello all,
I have programmatically changed a list item in a list control from "51" to "77" using the NI function "ReplaceListItem(.....)".
When I exited the program and looked at the list control I observed the list item still has "51" (instead of the expected "77").
The question is, "how do I permanently replace a list item in a list control?"
Thank you.
Bob
Solved! Go to Solution.
11-05-2012 05:01 PM
If I understand correctly, you have set some items in the list control within the UiR editor, next you want to change one of them programmatically and have this change reflected in the UIR file.
Well, if this is what you are trying to accomplish, there is no easy way to obtain it: changes operated programmatically terminate their scope when you exit the program and do not reflect in physical files. You should use the ActiveX interface to CVI, save the UIR in TUI format with CVI_AppConvertUIRToTUI () function, programmatically edit the TUI file, save it and then convert it back to UIR format by means of CVI_AppConvertTUIToUIR (). Not a trivial task, I'm afraid, and possibly this task is not worth the effort.
A more simple way is to have an external options file or configuration file where to store items to load in the list control when you need them: this file can be edited by yourself either programmatically or manually when you need to change some element.
11-05-2012 08:00 PM
I would choose the file option.
Thank you for your suggestion.
Bob