This would allow user to have :
PrintfTextBox(ghPanel, PANEL_TEXTBOX, "%s %d", "Hello CVI ", 2018);
In terms of implementation it could look like :
#define DEFAULT_LEN 1024 // Quick'n dirty fix
// ---------------------------------------------------------------------------- void PrintfTextBox(int panel, int CtrlId, const char *format, ...){ char StrTmp[DEFAULT_LEN]; va_list args; int NumLines; va_start (args, format); // could be nice also to have _vscprintf function call in CVI vsnprintf (StrTmp, DEFAULT_LEN, format, args); va_end (args); InsertTextBoxLine (panel, CtrlId, -1, StrTmp); GetNumTextBoxLines (panel, CtrlId, &NumLines); SetCtrlAttribute (panel, CtrlId, ATTR_FIRST_VISIBLE_LINE, NumLines); ProcessDrawEvents(); }
Regards, Philippe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.