title: Get cursor position of winforms textbox
body: <p>How do I get the current cursor (caret) position of a winforms textbox in .NET? SelectionStart only returns the start of the selected text (left side of the selection). Means this value is wrong if the cursor is at the right side of the selection.</p>
  
  <hr>
  
  <p>To clarify: In .NET TextBox SelectionStart points to the left side of an selection, also when the caret is at the right side of the selection. This means in both pictures SelectionStart is 2, but the caret position is 2 in the first picture and 7 in the right picture.</p>
  
  <p><a href="https://i.stack.imgur.com/mlNfX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mlNfX.png" alt="enter image description here"></a></p>