title: How to do text formating in C# for adjusting text in some control
body: <p>I have created a user control on winform where i want to display some text on Label Control at runtime.
  Here I used textFormatFlag as WordBreak and then displays it in the next line. Size of label is fixed in width while variable in height. Now the problem here is how to break a string if there is no space between i.e. no WordBreak Present in the string. 
  I dont want to do calculations on font size and accordingly modify string. Is it something hidden in .net that can do this work for me.</p>
  
  <pre><code>    sizeCategory = TextRenderer.MeasureText(Source["Parent_Name"].ToString()
                    , lbldbCategory.Font
                    , sizeCategory
                    , TextFormatFlags.WordBreak);
  </code></pre>
  
  <p>Consider lines as a boundary of my label. width height. Height being variable.
  Consider this eg.</p>
  
  <p><strong>My text string being</strong></p>
  
  <pre><code>"salkdjasldjkslakdjlsakjdlsakjdkajhk sdjahksajd" //see word break between the string
  -----------------------------------------------|
  salkdjasldjkslakdjlsakjdlsakjdkajhk            |
  sdjahksajd                                     |
  -----------------------------------------------|
  </code></pre>
  
  <p><strong>What I did</strong> and currently getting is this.</p>
  
  <p>due to word break</p>
  
  <pre><code>-----------------------------------------------|
  salkdjasldjkslakdjlsakjdlsakjd                 |
  kajhksdjahksajdh                               | 
  -----------------------------------------------|
  </code></pre>
  
  <p><strong>What is happening is</strong> when string has no space i.e. no word break</p>
  
  <pre><code>-----------------------------------------------|
  salkdjasldjkslakdjlsakjdlsakjdkajhksdjahksajdhasdasdasdsadasd|
  -----------------------------------------------|
  </code></pre>
  
  <p><strong>What I want is</strong> </p>
  
  <pre><code>-----------------------------------------------|
  salkdjasldjkslakdjlsakjdlsakjdkajhksdjahksajdha|
  sdasdasdsadasd                                 |
  -----------------------------------------------|
  </code></pre>