title: Set Focus back on edit after tab on Delphi xe2
body: <p>I have 7 edits where the user can put numbers,the numbers must be between 1100 and 1500. At the beginning, the first edit is focused, and the the user enter his number, and then he push tab to focus to the next edit...</p>
  
  <p>My program must verify the number that was entred by the user and if it dont satisfy the condition (1100
  
  <p>I tried this code on the Edit1Change but it won't work</p>
  
  <pre><code>If (1500 &lt; (strtofloat(edit1.text)) or (strtofloat(edit1.text) &lt;1100) then
  begin
    Showmessage ('my message');
    edit1.setfocus
  end;
  </code></pre>
  
  <h3>Update</h3>
  
  <p>Excuse me guys, my description for the problem wasn't very clear, and my english is not very good as well. </p>
  
  <p>I don't have problem with the comparison or checking the condition, my problem is that when I select the next Edit by pressing TAB, even if the condition wasn't satisified, my message appears, <code>Edit1.Text</code> is reset to 0 and the cursor moves to the next Edit control. What I want is that when the user presses Tab and the number entred doesn't satisfy the condition, the message appears, <code>Edit1.Text</code> takes 0 and the cursor stays on Edit1.</p>
  
  <p>I tried to place the checking of the condition and the instruction to give focus to the same edit in <code>Edit1.OnExit</code> but it won't work as well, always when the user presses Tab after entering a number that doesn't satisfy the condition, the message appears, the first Edit takes 0 and the cursor moves to the next Edit.</p>