Your question how can I make a string at runtime that refers to a control and use that in the SetCtrlVal command?
:
If your approach will allow you to programmatically create the controls for which you later need to SetCtrlVal
, or SetCtrlAttribute
, then the answer may be to experiment with the NewCtrl(,,,) function. It will allow you to create controls on the tab panels, and it will return a unique handle (ControlID) for each control it creates. All of the information is in the link, but here is its prototype:
int NewCtrl (int Panel_Handle, int Control_Style, char Control_Label[], int control_Top, int Control_Left);
Example code using NewCtrl is found here:
C:\Program Files (x86)\National Instruments\CVIxxxx\samples\userint\buildui.cws
C:\Program Files (x86)\National Instruments\CVIxxxx\samples\userint\ICOViewer.cws