whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1541)

Database (90)
Files (137)
Forms (107)
Graphic (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Math (76)
Misc (126)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (266)
VCL (242)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

28 Visitors Online


 
...handle lost focus problem in a TEdit?
Autor: Thomas Stutz
[ Print tip ]  

Tip Rating (5):  
     


To Reproduce the Problem:
Um das Problem nachzuvollziehen:

1. Drop two TEdits onto a form.
Plaziere zwei TEdits auf einer Form.

2. In the OnExit Event of Edit1 add the following code:
Im OnExit Ereignis von Edit1 schreibe diesen Code:

Application.MessageBox( 'Title','...', mb_ok );


3. Run the application.
Starte die Anwendung.


4. First select Edit1 then Edit2
Klicke auf Edit und dann auf Edit2


5. The Message box is shown.
Click the OK button, and the Caret has dissapeared!
Eine MessageBox wird angezeigt.
Klicke auf den OK Button und der Cursor ist verschwunden!



6. How to handle this:
Wie man das umgehen kann:


procedure TForm1.Edit1Exit(Sender: TObject);
begin
 Application.MessageBox('qq','qq',mb_ok);
 if Assigned(ActiveControl) then
   PostMessage(ActiveControl.Handle,WM_SETFOCUS,0,0);
end;





 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners