Pass the focus when exceed the capacity of a Tedit

 



When we try to exceed the capacity of a TEdit, this send a mesage EN_MAXTEXT to your parent window to inform it. In the form definition, we put:

 

type

     TForm1 = class(TForm)

     ..........

     private

       procedure WMCommand(var Msg: TWMCommand); message WM_COMMAND;

     ..........

     end;

 

and later, in the implementation:

 

Procedure TForm1.WMCommand ( Var Message : TWMCommand ) ;

Begin

   If Message.NotifyCode = EN_MAXTEXT Then

   Begin

      PostMessage ( Handle , WM_NEXTDLGCTL , 0 , 0 ) ;

      Inherited ;

   End ;

End ;


Back Home Foward