http://www./bbs/prime/viewprime.asp?id=117
如何在串太长时往让其末尾显示一个省略号(在SDI或MDI的View中)? [问题提出]
如何在串太长时往让其末尾显示一个省略号(在SDI或MDI的View中)? [程序实现] 建立名为My的SDI或MDI工程. void CMyView::OnDraw(CDC* pDC) { CMyDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here pDC->DrawText(CString("It's a long string,so we will add a '...' at the end."),CRect (110, 110, 180, 130),DT_LEFT | DT_END_ELLIPSIS); //Add ellpsis to middle of string if it does not fit pDC->DrawText(CString("It's a long string,so we will add a '...' at the end."),CRect (110, 140, 300, 160),DT_LEFT | DT_PATH_ELLIPSIS); } 运行看看. 结果:
![]() |
|
来自: zybingliu > 《VS windows》