正在加载图片...
void CDocViewView. OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 2 CDocView DOC * pDoc= GetDocumento if(nchar = VK RETURN pDoc->m strList AddTail(m strDisplay) Doc->m strLastLine Empty m strDisplay Empty nline+ else if(m strDisplay GetLengtho < 64) m strDisplay + nChar pDoc->m strLastLine =m strDisplay CClientDC dc(this) TEXTMETRIC tm dc. Get TextMetrics(&tm) int nLine Height = tm. tmHeight tm tmExtenalLeading dc Textout(0, m nLine *nLineHeight, m strDisplay CView: On Char(nChar, nRepCnt, nFlags)程序的实现步骤 void CDocViewView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) { CDocViewDoc *pDoc = GetDocument(); if(nChar == VK_RETURN) { pDoc->m_strList.AddTail(m_strDisplay); pDoc->m_strLastLine.Empty(); m_strDisplay.Empty(); m_nLine++; } else if(m_strDisplay.GetLength() < 64) { m_strDisplay += nChar; pDoc->m_strLastLine = m_strDisplay; } CClientDC dc(this); TEXTMETRIC tm; dc.GetTextMetrics(&tm); int nLineHeight = tm.tmHeight + tm.tmExternalLeading; dc.TextOut(0, m_nLine * nLineHeight, m_strDisplay); CView::OnChar(nChar, nRepCnt, nFlags); } 2.2
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有