CDC的DrawText函数可以很方便进行字符串的显示,DT_WORDBREAK属性可以支持自动换行,但是我发现它只能对汉字进行自动换行,对一般的字符则不予理睬,这是为什么?例如:
pDC->DrawText( "汉字进行自动换行", CRect(0,0,20,20),DT_WORDBREAK );
输出结果为:
汉字
进行
自动
换行
但是pDC->DrawText( "asdasdasdasdasdasd", CRect(0,0,20,20),DT_WORDBREAK );
输出结果则为:
asda
后面的字符给切掉了,为什么??
pDC->DrawText( "汉字进行自动换行", CRect(0,0,20,20),DT_WORDBREAK );
输出结果为:
汉字
进行
自动
换行
但是pDC->DrawText( "asdasdasdasdasdasd", CRect(0,0,20,20),DT_WORDBREAK );
输出结果则为:
asda
后面的字符给切掉了,为什么??
pDC->DrawText( "asdasdasdasdasdasd", CRect(0,0,20,20),DT_EDITCONTROL | DT_WORDBREAK );
pDC->DrawText( "asdasdasdasdasdasd", CRect(0,0,20,20),DT_LEFT|DT_NOPREFIX|DT_WORDBREAK);
--------------------------------------------------------------------------------
The information in this article applies to: Microsoft Win32 Application Programming Interface (API)
the operating system: Microsoft Windows XP
the operating system: Microsoft Windows 2000
the operating system: Microsoft Windows Millennium Edition
the operating system: Microsoft Windows 98 Second Edition
the operating system: Microsoft Windows 98