title: C# - Binding TextBox to an integer
body: <p>How to bind a TextBox to an integer? For example, binding unit to textBox1.</p>
  
  <pre><code>public partial class Form1 : Form
  {
      int unit;
  
      public Form1()
      {
          InitializeComponent();
  
  
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
          textBox1.DataBindings.Add("Text", unit, "???");
      }
  </code></pre>