Fórum o componenete nunca perde o foco #269018
17/02/2005
0
Eltontlms
Curtir tópico
+ 0Posts
17/02/2005
Somar
Gostei + 0
21/12/2005
Dooda
OnEnter do EdtPEsquisa : KeyPreview := False;
OnExit do EdtPEsquisa : KeyPreview := True;
Faça o tratamento da movimentações no OnKeyDown do EdtPesquisa Tipo:
#
if (shift = [ssctrl]) then // Control pressionado
begin
if (Key = VK_PRIOR) then // PAGE UP - Primeiro registro
dtsCondCapa.DataSet.First
else if (Key = VK_NEXT) then // PAGE DOWN - Último registro
dtsCondCapa.DataSet.Last;
Exit;
end;
if (Key = VK_PRIOR) then // PAGE UP - Volta 5
dtsCondCapa.DataSet.MoveBy(-5)
else if (Key = VK_NEXT) then // PAGE DOWN - Avança 5
dtsCondCapa.DataSet.MoveBy(5)
else if (Key = VK_UP) then // Seta para cima
begin
dtsCondCapa.DataSet.Prior;
Key := 0;
end
else if (Key = VK_DOWN) then // Seta para baixo
begin
dtsCondCapa.DataSet.Next;
Key := 0;
end
else if (Key = VK_RETURN) then // Alterar
begin
if btbAlterar.Enabled then
btbAlterar.OnClick(Sender);
Key := 0;
end
else if (Key = VK_INSERT) then // Incluir
begin
if btbIncluir.Enabled then
btbIncluir.OnClick(Sender);
Key := 0;
end
else if (Key = VK_ESCAPE) then // Esc
btbCancelar.SetFocus;
#
No meu caso o componente que mostrava os dados no DBGrid é DtsCondCapa que é um DataSource da paleta DBExpress...
Vallews, qualquer coisa, manda um e-mail....
Gostei + 0
21/12/2005
Marco Salles
Se eu entendi Direito....
procedure TFormConsultaProdutos.Edit1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Key = VK_Down Then Table1.Next //exemplo else if Key = Vk_Up then Table1.prior; end;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)