Fórum Como usar a tecla ENTER dentro do tabsheet? #279990
04/05/2005
0
Eh o seguinte criei um form com um PageControl, e dentro dele tem 9 tabsheet, ai eh o seguinte preciso que a tecla enter comande todos os tabsheet abrindo por sequencia tipo terminei o ultimo edit ele passa pro tabsheet2 e continua ate o final apertando somente o enter.
Fiz assim no form:
No Object Instepor Events do Form no OnKeyPress coloquei assim:
procedure TForm2.FormKeyPress(Sender: TObject; var Key: Char);
begin
if (Key = #13) then
begin
Key:= 0;
SelectNext(ActiveControl,true,true);
end;
If Key = 13 then
Perform(Wm_NextDlgCtl,0,0);
end;
E na Properties mudei o KeyPreview para True
So que ele pula do tabsheet1 pro tabsheet9
Alguem pode me ajudar!
Agradeço a todos pela atençao.
:?:
Adriano_servitec
Curtir tópico
+ 0Posts
04/05/2005
Brunobaco
Bruno Augusto
Gostei + 0
04/05/2005
Adriano_servitec
Gostei + 0
04/05/2005
Gandalf.nho
Gostei + 0
04/05/2005
Rômulo Barros
procedure MudarTabSheet(Var AKey : Char); Var C : Integer; begin If(AKey = #13)Then Begin With(PageControl1)Do Begin If(ActivePageIndex < PageCount -1)Then // Se não tiver na última TabSheet então... Begin ActivePageIndex := ActivePageIndex + 1; End Else Begin ActivePageIndex := 0 ; // Se tiver na última TabSheet então... selecionar a 1ª TabSheet End; End; End; end;
Agora, chame este método no evento [b:88421def16]OnKeyPress [/b:88421def16][u:88421def16]de apenas um Edit.[/u:88421def16]
Após isso, abra o [b:88421def16]combobox [/b:88421def16]do evento [b:88421def16]OnKeyPress [/b:88421def16][u:88421def16]de todos os outros Edits das outras TabSheets[/u:88421def16] e aponte para o [color=blue:88421def16][i:88421def16][u:88421def16][b:88421def16]Edit1KeyPress[/b:88421def16][/u:88421def16][/i:88421def16][/color:88421def16].
Gostei + 0
04/05/2005
Adriano_servitec
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)