SetDlgItemInt The SetDlgItemInt function sets the text of a control in a dialog box to the string representation of a specified integer value. void SetDlgItemInt( int nID, UINT nValue, BOOL bSigned = TRUE );
Parameters
nID
Specifies the integer ID of the control to be changed. (即控件的ID)
nValue
Specifies the integer value used to generate the item text.
bSigned
Specifies whether the integer value is signed or unsigned. If this parameter is TRUE, nValue is signed. If this parameter is TRUE and nValue is less than 0, a minus sign is placed before the first digit in the string. If this parameter is FALSE, nValue is unsigned.
The SetDlgItemInt function sets the text of a control in a dialog box to the string representation of a specified integer value. void SetDlgItemInt( int nID, UINT nValue, BOOL bSigned = TRUE );
Parameters
nID
Specifies the integer ID of the control to be changed.
(即控件的ID)
nValue
Specifies the integer value used to generate the item text.
bSigned
Specifies whether the integer value is signed or unsigned. If this parameter is TRUE, nValue is signed. If this parameter is TRUE and nValue is less than 0, a minus sign is placed before the first digit in the string. If this parameter is FALSE, nValue is unsigned.
这个没用过,都用SetDlgItemText
//设置IDC_NOW_SEE_DOCTOR的显示值为m_nCount, 无符号数。
//第一项,控件ID,第二项 数值;第三项:是否为有符号数。
BOOL SetDlgItemInt(HWND hDlg,int nIDDlgItem,UINT uValue,BOOL bSigned);
2.函数功能:
该函数将uValue的值设为对话框控件的文本。
3.参数说明:
(1)hDlg:指向对话框窗口的句柄。
(2)nIDDlgItem:要改变其文本的控件ID。
(3)uValue:指向要设置的值。
(4)bSigned:指定uValue是否为一个有符号的值。
4.注意事项:
在windows CE系统中,忽略bSigned参数,系统认为uValue始终为有符号的值。
函数将发送WM_SETTEXT消息给指定的控件。
若要发送文本给指定的控件(nIDDlgItem),可以使用SetDlgItemText.