int DrawText( HDC hDC, // handle to device context LPCTSTR lpString, // pointer to string to draw int nCount, // string length, in characters LPRECT lpRect, // pointer to struct with formatting dimensions UINT uFormat // text-drawing flags ); Call this member function to format text in the given rectangle. 看msdn
CSize TabbedTextOut( int x, int y, const CString& str, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin );Call this member function to write a character string at the specified location, expanding tabs to the values specified in the array of tab-stop positions
pDC->TextOut(strText);
%10x,里面的10就是由你自己定的!
HDC hDC, // handle to device context
LPCTSTR lpString, // pointer to string to draw
int nCount, // string length, in characters
LPRECT lpRect, // pointer to struct with formatting dimensions
UINT uFormat // text-drawing flags
);
Call this member function to format text in the given rectangle.
看msdn
strText.Format("%10x%10x%10x%10x", s, h, w, c);
简单搞定;
否则你就必须计算纵横坐标,逐一调用TextOut输出。
然后在按相同宽度的格式在同一横坐标输出。