⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 第七章4.txt

📁 本书在复习C++基础知识后
💻 TXT
字号:
void CEx_A7View::DrawInfoWnd(CDC *pDC, CPoint pt, CString strInfo)
{
	CRect rcWnd( pt.x, pt.y - 15, pt.x + 80, pt.y );
	pDC->FillSolidRect( rcWnd, RGB( 0, 0, 128 ) );
	pDC->Draw3dRect( rcWnd, RGB(255,255,255), RGB(255,255,255) );

	// 定义并设置文本字体
	LOGFONT	lfText;
	memset(&lfText, 0, sizeof(LOGFONT));
	lfText.lfHeight		= -12;	
	lfText.lfCharSet	= GB2312_CHARSET;
	strcpy(lfText.lfFaceName, "宋体");	
	CFont		cf;	
	cf.CreateFontIndirect(&lfText); 
	CFont *oldFont	= pDC->SelectObject( &cf );

	pDC->SetBkColor( RGB( 0, 0, 128 ) );
	pDC->SetTextColor( RGB( 192, 192, 0 ) );
	pDC->DrawText( strInfo, rcWnd, DT_CENTER | DT_VCENTER | DT_SINGLELINE );

	pDC->SelectObject( oldFont );
	cf.DeleteObject();					// 删除字体对象
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -