use*_*023 3 c# string wpf alignment
我想打印这样的数据:
http://www.csharp-examples.net/align-string-with-spaces/
------------------------------- Bi1l | Gates | 51 EdnA | Parker | 114 JohNny | Depp | 44 -------------------------------
我尝试使用上面的例子,PadRight以及PadLeft更多的长度计算,我总是得到这种类型的输出(我的输出转到a TextBox)
------------------------------- Bill | Gates | 51 Edna | Parker | 114 Johnny | Depp | 44 -------------------------------
对于我的想法,它发生是因为WPF不为每个字符提供固定和相等的块,因此W占用更多的空间i,并使分离看起来很糟糕.
有人可以帮我解决问题吗?
您可以更改字体类型等宽字体(维基百科)一样Courier.
根据连锁维基百科文章的其他可能的字体类型Courier New,Lucida Console,Monaco或Consolas.
或者,您可以使用某种网格控件(如DataGrid控件)更改UI并显示数据,以显示数据.