方法1:
//设置字体 CFont* pFont = GetDlgItem(IDC_ConnInfo)->GetFont(); LOGFONT LogFont; pFont->GetLogFont(&LogFont); LogFont.lfHeight = 26; //设置字体大小 LogFont.lfWeight = FW_NORMAL; //设置字体粗细 LogFont.lfItalic = FALSE; //是否斜体 LogFont.lfUnderline = FALSE; //是否下划线 LogFont.lfStrikeOut = FALSE; //是否删除线 LogFont.lfQuality = PROOF_QUALITY; strcpy_s(LogFont.lfFaceName, 32, "微软雅黑"); //设置字体 pFont->Detach(); pFont->CreateFontIndirect(&LogFont); GetDlgItem(IDC_ConnInfo)->SetFont(pFont); pFont->Detach(); //显示信息 CString sInfo = "正在连接设备, 请稍等..."; GetDlgItem(IDC_ConnInfo)->SetWindowText(sInfo);
时间: 2024-10-05 03:34:06