开发者

how do I set a value of a textbox in Visual C++

开发者 https://www.devze.com 2023-01-25 17:23 出处:网络
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

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消