Problemas com Perform
10/09/2005
0
Pessoal é o seguinte eu chamo um formulário dentro de um panel, quando eu aperto a tecla tab ele funciona belezinha, só que no Key Press do edit eu coloquei o seguinte codigo:
if(Key = #13)then
Perform(WM_NEXTDLGCTL,0,0);
e quando eu aperto a tecla enter ele entar na funcao só que não acontece nada, eu ja coloquei como abaixo mais não acontece nada também:
meuform.Perform(WM_NEXTDLGCTL,0,0);
obrigado
if(Key = #13)then
Perform(WM_NEXTDLGCTL,0,0);
e quando eu aperto a tecla enter ele entar na funcao só que não acontece nada, eu ja coloquei como abaixo mais não acontece nada também:
meuform.Perform(WM_NEXTDLGCTL,0,0);
obrigado
Leonardobhbr
Curtir tópico
+ 0
Responder
Post mais votado
11/09/2005
Você poderia fazer assim:
Uses Grids
...
procedure TfrmPri.MudarComEnter(var Msg: TMsg; var Handled:Boolean);
begin
If not ((Screen.ActiveControl is TCustomMemo) or
(Screen.ActiveControl is TCustomGrid) or
(Screen.ActiveForm.ClassName = ´TMessageForm´)) then
begin
If Msg.message = WM_KEYDOWN then
begin
Case Msg.wParam of
VK_RETURN: Screen.ActiveForm.Perform(WM_NextDlgCtl,0,0);
VK_UP : Screen.ActiveForm.Perform(WM_NextDlgCtl,1,0);
end;
end;
end;
end;
no evento OnCreate o Form Principal digite a seguinte linha
Application.OnMessage := MudarComEnter;
Desse jeito, em toda a aplicação o Enter substituiria o tab, e a seta para cima, substitui o presionamento de Shift+Tab.
(Tirada de dicas Deephi)
Uses Grids
...
procedure TfrmPri.MudarComEnter(var Msg: TMsg; var Handled:Boolean);
begin
If not ((Screen.ActiveControl is TCustomMemo) or
(Screen.ActiveControl is TCustomGrid) or
(Screen.ActiveForm.ClassName = ´TMessageForm´)) then
begin
If Msg.message = WM_KEYDOWN then
begin
Case Msg.wParam of
VK_RETURN: Screen.ActiveForm.Perform(WM_NextDlgCtl,0,0);
VK_UP : Screen.ActiveForm.Perform(WM_NextDlgCtl,1,0);
end;
end;
end;
end;
no evento OnCreate o Form Principal digite a seguinte linha
Application.OnMessage := MudarComEnter;
Desse jeito, em toda a aplicação o Enter substituiria o tab, e a seta para cima, substitui o presionamento de Shift+Tab.
(Tirada de dicas Deephi)
Thomaz_prg
Responder
Mais Posts
12/09/2005
Steve_narancic
Ao invés de:
tente:
Perform(WM_NEXTDLGCTL,0,0);
tente:
keybd_event(VK_TAB, 0, KEYEVENTF_EXTENDEDKEY or 0, 0);
Responder
20/06/2019
Wilson Rabelo
Você poderia fazer assim:
Uses Grids
...
procedure TfrmPri.MudarComEnter(var Msg: TMsg; var Handled:Boolean);
begin
If not ((Screen.ActiveControl is TCustomMemo) or
(Screen.ActiveControl is TCustomGrid) or
(Screen.ActiveForm.ClassName = ´TMessageForm´)) then
begin
If Msg.message = WM_KEYDOWN then
begin
Case Msg.wParam of
VK_RETURN: Screen.ActiveForm.Perform(WM_NextDlgCtl,0,0);
VK_UP : Screen.ActiveForm.Perform(WM_NextDlgCtl,1,0);
end;
end;
end;
end;
no evento OnCreate o Form Principal digite a seguinte linha
Application.OnMessage := MudarComEnter;
Desse jeito, em toda a aplicação o Enter substituiria o tab, e a seta para cima, substitui o presionamento de Shift+Tab.
(Tirada de dicas Deephi)
Obrigado.Uses Grids
...
procedure TfrmPri.MudarComEnter(var Msg: TMsg; var Handled:Boolean);
begin
If not ((Screen.ActiveControl is TCustomMemo) or
(Screen.ActiveControl is TCustomGrid) or
(Screen.ActiveForm.ClassName = ´TMessageForm´)) then
begin
If Msg.message = WM_KEYDOWN then
begin
Case Msg.wParam of
VK_RETURN: Screen.ActiveForm.Perform(WM_NextDlgCtl,0,0);
VK_UP : Screen.ActiveForm.Perform(WM_NextDlgCtl,1,0);
end;
end;
end;
end;
no evento OnCreate o Form Principal digite a seguinte linha
Application.OnMessage := MudarComEnter;
Desse jeito, em toda a aplicação o Enter substituiria o tab, e a seta para cima, substitui o presionamento de Shift+Tab.
(Tirada de dicas Deephi)
Responder
Clique aqui para fazer login e interagir na Comunidade :)