Ver Mensaje Individual
  #16  
Antiguo 19-05-2017
Avatar de oscarac
[oscarac] oscarac is offline
Miembro Premium
 
Registrado: sep 2006
Ubicación: Lima - Perú
Posts: 2.009
Reputación: 20
oscarac Va por buen camino
Si hago esto me funciona a la perfeccion, si alguien pudiera optimizarlo o colocarlo en una libreria para invocarlo o ver una mejor forma estare muy atento

Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    edt1: TEdit;
    edt2: TEdit;
    edt3: TEdit;
    edt4: TEdit;
    edt5: TEdit;
    edt6: TEdit;
    procedure edt1Exit(Sender: TObject);
    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.edt1Exit(Sender: TObject);
begin
  edt2.Enabled := edt1.Text = '2';
  edt3.Enabled := edt1.Text = '2';
  edt4.Enabled := edt1.Text = '3';
  if edt2.Enabled then edt2.SetFocus
  else
    if edt3.Enabled then edt3.SetFocus
      else
        if edt4.Enabled then edt4.SetFocus
          else
            if edt5.Enabled then edt5.SetFocus
              else
                if edt6.Enabled then edt6.SetFocus;

end;

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
case Key of

  VK_RETURN: begin
      SelectNext(ActiveControl, True, True);
      Key := 0;
    end;
        VK_UP: begin
      SelectNext(ActiveControl, False, True);
      Key := 0;
    end;

    VK_DOWN: begin
      SelectNext(ActiveControl, True, True);
      Key := 0;
    end;
end;
end;

end.
__________________
Dulce Regalo que Satanas manda para mi.....
Responder Con Cita