编写一个应用程序,在客户区利用DrawText()函数显示三行文本。
展开全部
1.我写了个示例工程,下载地址:http://sites.google.com/site/qiujiejia1/Home/DrawText.zip
2.部分主要代码:
void CDemoDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
RECT rect={0,400,200,20};
::DrawText (dc.m_hDC,"大方广:www.dfg.cn", -1,&rect,DT_SINGLELINE | DT_LEFT | DT_VCENTER |DT_END_ELLIPSIS ) ;
RECT rect1={0,440,400,20};
::DrawText (dc.m_hDC,"其身正,不令而行,其身不正,虽令不从", -1,&rect1,DT_SINGLELINE | DT_LEFT | DT_VCENTER |DT_END_ELLIPSIS ) ;
RECT rect2={0,480,200,20};
::DrawText (dc.m_hDC,"行有不得,反求诸己", -1,&rect2,DT_SINGLELINE | DT_LEFT | DT_VCENTER |DT_END_ELLIPSIS ) ;
}
2.部分主要代码:
void CDemoDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
RECT rect={0,400,200,20};
::DrawText (dc.m_hDC,"大方广:www.dfg.cn", -1,&rect,DT_SINGLELINE | DT_LEFT | DT_VCENTER |DT_END_ELLIPSIS ) ;
RECT rect1={0,440,400,20};
::DrawText (dc.m_hDC,"其身正,不令而行,其身不正,虽令不从", -1,&rect1,DT_SINGLELINE | DT_LEFT | DT_VCENTER |DT_END_ELLIPSIS ) ;
RECT rect2={0,480,200,20};
::DrawText (dc.m_hDC,"行有不得,反求诸己", -1,&rect2,DT_SINGLELINE | DT_LEFT | DT_VCENTER |DT_END_ELLIPSIS ) ;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询