C# Path Ellipsis without Win32 API call

前端 未结 2 614
暗喜
暗喜 2021-01-14 17:17

I have a long path I\'d like to shorten for displaying on a form using the ellipsis character(s?).

I know there is the PathCompactPathEx Win32 API call, but I know t

2条回答
  •  孤街浪徒
    2021-01-14 17:54

    Your own link has

    Alternative Managed API: System.Windows.Forms.TextRenderer.MeasureText(String, Font, Size, TextFormatFlags.ModifyString | TextFormatFlags.PathEllipsis);

    at the bottom. Is that what you are looking for?

提交回复
热议问题