title: How can I truncate the selected text in a delphi combobox?
body: <p>I have a combobox with its style set to csDropDown. I am trying to do this in the OnSelect event handler;</p>
  
  <pre><code>if cboEndTime.ItemIndex &gt; -1 then
    cboEndTime.Text := AnsiLeftStr(cboEndTime.Text, 5);
  </code></pre>
  
  <p>but it has no effect.</p>
  
  <p>The combo items look like this;</p>
  
  <p>09:00 (0 minutes)<br>
  09:30 (30 minutes)<br>
  10:00 (1 hour)<br>
  10:30 (1.5 hours)<br>
  ...</p>
  
  <p>If i select the second item for example, I want the text of the combobox to show 09:30, ie truncated. Which would set ItemIndex to -1.</p>
  
  <p>How can I achive this?</p>