MFC中int转化cstring
2013-12-08 22:10
459 查看
void CColorDlgDlg::OnBnClickedColorButton() { // TODO: 在此添加控件通知处理程序代码 COLORREF color = RGB(255, 0, 0); CColorDialog colorDlg(color); if (IDOK == colorDlg.DoModal()) { color = colorDlg.GetColor(); SetDlgItemInt(IDC_COLOR_EDIT, color); /*SetDlgItemInt(IDC_R_EDIT, GetRValue(color)); SetDlgItemInt(IDC_G_EDIT, GetGValue(color)); SetDlgItemInt(IDC_B_EDIT, GetBValue(color));*/ CString cstrR; CString cstrG; CString cstrB; cstrR.Format(_T("%d"), (unsigned int)GetRValue(color)); cstrG.Format(_T("%d"), (unsigned int)GetGValue(color)); cstrB.Format(_T("%d"), (unsigned int)GetBValue(color)); SetDlgItemText(IDC_R_EDIT, cstrR); SetDlgItemText(IDC_G_EDIT, cstrG); SetDlgItemText(IDC_B_EDIT, cstrB); } }
相关文章推荐
- MFC CString 和int相互转化
- MFC Cstring 和int 类型的转化
- MFC CString 和int相互转化
- CString 和int相互转化 MFC
- MFC CString 和int相互转化
- MFC CString 和int相互转化
- MFC中 CString与int的转化
- MFC Cstring转化为string
- MFC中,Unicode和多字节字符集下 CString和char的转化
- MFC int 和CString的相互转化实例
- CString和int的相互转化
- MFC CString转化为char*
- int与CString,char*与CString,float与CString之间的相互转化
- c++ MFC int与CString互转
- c++ MFC int 转换成 CString
- Unicode 字符集下,CString 型转化成int 型
- MFC/C++/C中字符类型CString, int, string, char*之间的转换
- CString和string 、CString和int、char*和CString的转化
- CString/string/char*/char[]/int/float相互转化
- MFC int 和CString的相互转化实例