title: Delphi - using selstart and sellength, but with cursor in the left (selstart position) instead end (sellength position)
body: <p>I'm using Delphi to develop a DBLookupComboBox component with your own SQL (using Devart UniDac), without external ListSource, ListField, KeyField. Everything is working perfectly fine, but for a better user interface, I need one small detail. </p>
  
  <p>I always leave the selected text according to the user's typing. When characters are typed, all right; but, when movement keys are typed (VK_LEFT, VK_RIGHT, combinations and etc.), the process is not cool, because the SelStart/SelLength places the cursor at the end of the text (sellength) and I want the cursor in the left (at SelStart), next to the last letter typed.</p>
  
  <p>The component (using TFrame, TEdit and etc).</p>
  
  <p><a href="https://i.stack.imgur.com/MhHs8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MhHs8.png" alt="enter image description here"></a></p>
  
  <p>User typed BIAN, my component find the first person and use SelStart/SelLength to highlight.</p>
  
  <p><a href="https://i.stack.imgur.com/1tb7n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1tb7n.png" alt="enter image description here"></a></p>
  
  <p>User typed VK_LEFT, my component should show this:</p>
  
  <p><a href="https://i.stack.imgur.com/Ke2Ws.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ke2Ws.png" alt="enter image description here"></a></p>
  
  <p>But show this:</p>
  
  <p><a href="https://i.stack.imgur.com/fnCcp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fnCcp.png" alt="enter image description here"></a></p>