title: Setting button alignment programmatically
body: <p>I'm creating some 50 button dynamically.<br>
  Text is getting set as followed:</p>
  <pre><code>btn.Text=result.Rows[i][&quot;Col1&quot;].ToString()+&quot;\n&quot;+result.Rows[i][&quot;Col2&quot;].ToString()
  +&quot;\n&quot;+result.Rows[i][&quot;Col3&quot;].ToString();
  </code></pre>
  <p>where <code>result</code> is <code>DataTable</code> &amp; <code>btn</code> is object for button.</p>
  <p>Now the problem is some of the buttons are not getting displayed appropriately.</p>
  <p>Referring to screenshot below,</p>
  <p>in img1 - An unnecessary blank line is getting displayed after the first row.<br>
  in img2 - Text is not center aligned.<br>
  in img3 - <em>TATAMOTORS</em> is not getting displayed in single line even though there is a space on either side of t he button.</p>
  <p>Please note that I'm <strong>not setting padding</strong> which can be the reason for this.</p>
  <p>Any idea how to solve this?<br>
  Also, how alignment of text of a button can be set <strong>programmatically</strong>?</p>
  <p>I know that this is not the Best of the question, but after spending hours on it, I'm unable to crack it.</p>
  <p><em>Any help appreciated...</em></p>
  <p><img src="https://i.imgur.com/rHowX.png" alt="Screen shot" /></p>