Fórum Funcionar enter em CLX #205506
10/01/2004
0
e ai meu povo blzzzz
o Exemplo abaixo funciona em VCL eu uso atualmente
porem eu preciso que funcione em CLX
esse exemplo faz o enter funcionar e a cetinha pra cima e pra baixo tambem
//=== cria uma procecdure no form principal
procedure ProcessaMsg(var Msg: tagMSG; var Handled : Boolean) ;
//=== a procedure
procedure TFRMMenu.ProcessaMsg (var Msg: TMsg; var Handled : Boolean) ;
Begin
if Msg.message = WM_KEYDOWN then
begin
if not (Screen.ActiveControl is TCustomMemo) and
not (Screen.ActiveControl is TButtonControl) and
not (Screen.ActiveControl is TCustomDBGrid) and
not (Screen.ActiveControl is TCustomComboBox) and
not (Screen.ActiveControl is TDBLookUpComboBox) then
begin
if not (Screen.ActiveControl is TCustomControl) then
begin
if Msg.wParam = KEY_Down then Msg.wParam := KEY_TAB;
if Msg.wParam = KEY_UP then
begin
Msg.wParam := KEY_CLEAR;
Screen.ActiveForm.Perform(WM_NextDlgCtl,1,0);
end;
end;
if Msg.wParam = KEY_Return then Msg.wParam := KEY_TAB;
end;
end;
End;
//=== no evento oncreate do formo coloco
Application.OnMessage := ProcessaMsg;
o Exemplo abaixo funciona em VCL eu uso atualmente
porem eu preciso que funcione em CLX
esse exemplo faz o enter funcionar e a cetinha pra cima e pra baixo tambem
//=== cria uma procecdure no form principal
procedure ProcessaMsg(var Msg: tagMSG; var Handled : Boolean) ;
//=== a procedure
procedure TFRMMenu.ProcessaMsg (var Msg: TMsg; var Handled : Boolean) ;
Begin
if Msg.message = WM_KEYDOWN then
begin
if not (Screen.ActiveControl is TCustomMemo) and
not (Screen.ActiveControl is TButtonControl) and
not (Screen.ActiveControl is TCustomDBGrid) and
not (Screen.ActiveControl is TCustomComboBox) and
not (Screen.ActiveControl is TDBLookUpComboBox) then
begin
if not (Screen.ActiveControl is TCustomControl) then
begin
if Msg.wParam = KEY_Down then Msg.wParam := KEY_TAB;
if Msg.wParam = KEY_UP then
begin
Msg.wParam := KEY_CLEAR;
Screen.ActiveForm.Perform(WM_NextDlgCtl,1,0);
end;
end;
if Msg.wParam = KEY_Return then Msg.wParam := KEY_TAB;
end;
end;
End;
//=== no evento oncreate do formo coloco
Application.OnMessage := ProcessaMsg;
Mysys
Curtir tópico
+ 0
Responder
Posts
10/01/2004
Aroldo Zanela
Colega,
Numa pesquisa realizada aqui no fórum, encontrei a seguinte solução:
Numa pesquisa realizada aqui no fórum, encontrei a seguinte solução:
if key = #13 then Selectnext(activecontrol,true,true); end; else key := 0;
Responder
Gostei + 0
10/01/2004
Rfpsatin
declare a Unit Qt na uses.
if key=key_return then selectnext(activecontrol,true,true)
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)