title: Is there a combination of TextFormatFlags to allow text wrapping and an ending ellipsis?
body: <p>I have been unable to put together a bit of string rendering code that gives me everything I am aiming for.  To this point, only trade-offs.</p>
  
  <p>I am shooting for something that behaves the way Windows7 desktop shortcuts do, in that there is an image above text and that text can wrap once, with anything more truncated with an ellipse.</p>
  
  <p>Such as:</p>
  
  <p><img src="https://i.stack.imgur.com/qRic5.png" alt="enter image description here"></p>
  
  <p>I am using <code>TextRenderer.DrawText</code> and I have tried various combinations of <code>TextFormatFlags</code>, but I can only get <em>either</em> text that wraps indefinitely, <em>or</em> text that stops at a single line and has the ellipsis.</p>
  
  <p>Some examples.  The bounds provided to <code>TextRenderer</code> are, in all cases, within the bounds of the <code>ClipRectangle</code> of the surface in which I am drawing.  The text it is attempting to render is "This is the rather long name of a group called #1.".</p>
  
  <p>This code:</p>
  
  <pre><code>TextFormatFlags flags = TextFormatFlags.HorizontalCenter | 
       TextFormatFlags.NoPadding | TextFormatFlags.WordBreak | 
       TextFormatFlags.EndEllipsis;
  Rectangle rect = new Rectangle(x, y, this.Width - 6, this.Height - y);
  TextRenderer.DrawText(e.Graphics, _text, Font, rect, _textColor, flags);
  </code></pre>
  
  <p>...produces this:</p>
  
  <p><img src="https://i.stack.imgur.com/95xk2.png" alt="enter image description here"></p>
  
  <p>While simply removing the <code>TextFormatFlags.WordBreak</code> flag produces:</p>
  
  <p><img src="https://i.stack.imgur.com/65y0B.png" alt="enter image description here"></p>
  
  <p>How can I do this such as I get wrapping as far as is possible within the bounds of the <code>Rectangle</code> I pass, followed by an ending ellipse when truncation occurs?</p>