title: RichTextBox doesnt show scrollbars and text goes off limit
body: <p>I have a TabControl with one TabPage with a RichTextBox inside that I added with the windows form design tool and an option in a menu to add more TabPages and RichTextBoxes. When I fill the Richtextbox that I added manually with text the vertical scrollbar appears and the text is inside the limits od the textbox, but when I fill with text a richtextbox that I added with the menu option the text goes beyond the limits of the textbox and no scrollbars appear.</p>
  
  <p>How can I make the richtextboxes that I add behave properly?</p>
  
  <p>this is the code I use to add the tabpages and the richtetxboxes:</p>
  
  <p>I've already tried setting multiline True and forcing the scrollbars. </p>
  
  <p>EDIT: I know what it is. For some reason when I set the size of myRichTextBox it actually makes it bigger than the richtextbox I added in the design tool even tho they are the same size, so the text actually "fits" but it is off limits.</p>
  
  <pre><code>private void AgregarPestañaToolStripMenuItem_Click(object sender, EventArgs e)
  {
      string title = "Pestaña " + (tabControl1.TabCount + 1).ToString();
      string name = "richTextBox" + (tabControl1.TabCount + 1).ToString();
      TabPage myTabPage = new TabPage(title);
      RichTextBox myRichTextBox= new RichTextBox();
      myRichTextBox.Location = new System.Drawing.Point(0, 0);
      myRichTextBox.Name = name;
      myRichTextBox.Size = new System.Drawing.Size(500, 500);
      myRichTextBox.TabIndex = 0;
      myRichTextBox.Text = "";
      myRichTextBox.Multiline = true;
      myRichTextBox.ScrollBars = RichTextBoxScrollBars.ForcedBoth ;
      textAreas.Add(myRichTextBox);
      myTabPage.Controls.Add(myRichTextBox);
      tabControl1.TabPages.Add(myTabPage);
  }
  </code></pre>
  
  <p>This is the code inside <code>InitializeComponent()</code>:</p>
  
  <pre><code>// richTextBox1
  // 
  this.richTextBox1.Location = new System.Drawing.Point(0, 0);
  this.richTextBox1.Name = "richTextBox1";
  this.richTextBox1.Size = new System.Drawing.Size(480, 480);
  this.richTextBox1.TabIndex = 0;
  this.richTextBox1.Text = "";
  </code></pre>
  
  <h1>UPDATE</h1>
  
  <p>I fixed the problem, apparently Visual Studio was scaled 125% and because of the way it detects the size of components, the values were incorrect.</p>