Função fica emitindo um beep, chato.. tem como remover?

Delphi

26/03/2006

Olá, uso a seguinte função para pular de campo com o ENTER, porém toda hora que aperto o ENTER ele fica dando um BEEP... no inicio eu achei legal, mas num cadastro de 50 campos.. poutz.. enche o saco.. tem como eu remover este beep?

Desde já agradeço...

[]s

 with Screen.ActiveForm do
 begin
  Key := AnsiUpperCase(Key)[Length(Key)];
  if (Key = 13) then
  begin
   Key := 0;
   if (ActiveControl is TJvComboEdit) then
   begin
    (ActiveControl as TJvComboEdit).Button.Click;
    Key := 0;
    Perform(Wm_NextDlgCtl, 0, 0);
   end
   else
   begin
    if (ActiveControl is TJvDBComboEdit) then
    begin
     (ActiveControl as TJvDBComboEdit).Button.Click;
     Key := 0;
     Perform(Wm_NextDlgCtl, 0, 0);
    end
    else
     Perform(Wm_NextDlgCtl, 0, 0);
   end;
  end;
  if (Key = 27) and (Screen.ActiveForm <> nil) then
  begin
   Key := #0;
   try
    if (FindComponent(´BtnCancelar´) <> nil) and (TBitBtn(FindComponent(´BtnCancelar´)).Enabled) then
     TBitBtn(FindComponent(´BtnCancelar´)).Click
    else
     Close;
   except
   end;
  end;
  Result := Key;
 end;
end;




Titanius

Titanius

Curtidas 0

Respostas

Alexandre_torres

Alexandre_torres

26/03/2006

Amigo,

Não conheço está função, porém uso uma filé aqui. Vê ai...

if key = #13 then
begin
key := 0;
SelectcNext(Activecontrol, true, true);
end;

espero ter ajudado.

T+


GOSTEI 0
Titanius

Titanius

26/03/2006

Aqui não funcionou... tenho que adicionar alguma Unit?


[]s


GOSTEI 0
Alexandre_torres

Alexandre_torres

26/03/2006

Da uma olhada se o keyPreview está como true...

T+


GOSTEI 0
Alexandre_torres

Alexandre_torres

26/03/2006

do formulário em questão....

T+


GOSTEI 0
Marco Salles

Marco Salles

26/03/2006

Verifique a sintaxe:
[b:22c3929537]SelectcNext -->>> SelectNext[/b:22c3929537]
sugestão sem compromisso


GOSTEI 0
POSTAR