title: Button inside a WinForms textbox
body: <p>Do WinForms textboxes have any properties that make an embedded button, at the end of the box, possible?</p>
  
  <p>Something like the favorites button on the Chrome address box:</p>
  
  <p><img src="https://i.stack.imgur.com/lUier.png" alt="enter image description here"></p>
  
  <p>I've also seen something like the following in some Excel forms:</p>
  
  <p><img src="https://i.stack.imgur.com/4m612.png" alt="enter image description here"></p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>I've followed Hans Passant's answer with the addition of a click event handler and it seem to work ok:</p>
  
  <pre><code>protected override void OnLoad(EventArgs e) {
      var btn = new Button();
      btn.Size = new Size(25, textBoxFolder.ClientSize.Height + 2);
      btn.Location = new Point(textBoxFolder.ClientSize.Width - btn.Width, -1);
      btn.Cursor = Cursors.Default;
      btn.Image = Properties.Resources.arrow_diagright;
      btn.Click += btn_Click;     
      textBoxFolder.Controls.Add(btn);
      // Send EM_SETMARGINS to prevent text from disappearing underneath the button
      SendMessage(textBoxFolder.Handle, 0xd3, (IntPtr)2, (IntPtr)(btn.Width &lt;&lt; 16));
      base.OnLoad(e);
  }
  
  [System.Runtime.InteropServices.DllImport("user32.dll")]
  private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp);
  
  private void btn_Click(object sender, EventArgs e) {
      MessageBox.Show("hello world");
  }
  </code></pre>