how do I set a value 开发者_开发问答of a textbox in Visual C++? I have been trying the following but the line strTemp.Format("%d", nNbr); does not compile thanks
int nNbr = 5;
CString strTemp;
strTemp.Format("%d", nNbr);
textBox.SetWindowTextW(strTemp);
You probably need to use the _T macro in order to support both ANSI
and UNICODE
builds of your application:
int nNbr = 5;
CString strTemp;
strTemp.Format(_T("%d"), nNbr);
textBox.SetWindowText(strTemp);
精彩评论