m_hIcon);
}
else
{
CPaintDC dc(this); // device context for painting
dc.SetTextColor(RGB (180,240,210));
dc.SetBkMode(TRANSPARENT); //设置背景为透明!
CRect rect;
rect.left=150;
rect.right=350;
rect.top=10;
rect.bottom=40;
dc.Rectangle(&rect);
dc.FillRect(&rect,&m_brush1);
rect.left=10;
rect.right=135;
rect.top=40;
rect.bottom=200;
dc.Rectangle(&rect);
dc.FillRect(&rect,&m_brush1);
dc.TextOut(WidthX,15,m_str);
dc.TextOut(15,Heighty,m_str);
// CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CGundongDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CGundongDlg::OnTcomr(UINT nIDEvent)
{
枫叶文学网www.fywxw.com
第6 章 文本和字体类
·157·
// TODO: Add yourcomssage handler code here and/or call default
DrawV();
DrawH();
CDialog::OnTcomr(nIDEvent);
}
void CGundongDlg::DrawV() //竖直方向滚动函数
{
CRect rect; //每次重画区域大小
rect.left=10;
rect.right=m_str.GetLength()+rect.left+120;
CFont * font=GetFont();
LOGFONT logFont;
font->GetLogFont(&logFont);
rect.top=Heighty;
rect.bottom=rect.top+logFont.lfHeight+40;
InvalidateRect(&rect);
Heighty+=logFont.lfHeight+18; //每步向下移