Fórum Componente Enter x Tab #164760
05/06/2003
0
Grato
Fabiano
Se tiverem por gentileza passem no email...
fabianosouza@acif.com.br
________
´O Senhor é meu pastor e nada me faltara´
[b:7d6ab19620][color=blue:7d6ab19620][/color:7d6ab19620][i:7d6ab19620][/i:7d6ab19620][/b:7d6ab19620]
Fabianosouza
Curtir tópico
+ 0Posts
05/06/2003
Luc.morais
Outra opção é acrescentar o seguinte código ao evento OnKeyPress de cada form:
if (Key = #13)
then Perform(WM_NEXTDLGCTL,0,0);
Não esquecer de colocar a propriedade KeyPreview = True para cada form.
Luciano
Gostei + 0
05/06/2003
Cristiane
651 - Enter funcionando como Tab em toda a aplicação 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,VK_DOWN : 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;
Nao testei ainda... essa dica está no programa 750 dicas de Delphi.
Download do programa (agora acho que ja saiu o 800 dicas) em :
www.lloydsoft.hpg.ig.com.br
Gostei + 0
26/01/2011
Vergilio Araujo
unit TabEnter;
interface
uses SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms, Dialogs, Buttons, StdCtrls;
type TkEnterAsTab = class(TSpeedButton) private FEnterAsTab : boolean; protected procedure CMDialogKey(var Message: TCMDialogKey); message CM_DIALOGKEY; procedure Paint; override; public constructor Create(AOwner: TComponent); override; published property EnterAsTab: boolean read FEnterAsTab write FEnterAsTab default True; end;
procedure Register;
implementation
constructor TkEnterAsTab.Create(AOwner: TComponent);begin inherited Create(AOwner); FEnterAsTab := True;
if not (csDesigning in ComponentState) then begin Enabled := False; Visible := False; end else begin Font.Name := 'Small Fonts'; Font.Size := 7; Caption := 'Enter'; Flat := True; Transparent := False; end;end;
procedure TkEnterAsTab.CMDialogKey(var Message : TCMDialogKey);begin if (GetParentForm(Self).ActiveControl is TButtonControl) and not (GetParentForm(Self).ActiveControl is TCheckBox) and not (GetParentForm(Self).ActiveControl is TRadioButton) then inherited else if (Message.CharCode = VK_RETURN) and (EnterAsTab) then begin GetParentForm(Self).Perform(CM_DialogKey, VK_TAB, 0);
Message.Result := 1; end else inherited;end;
procedure TkEnterAsTab.Paint;begin if (csDesigning in ComponentState) then begin Width := 27; Height := 27; end; inherited Paint;end;
procedure Register;begin RegisterComponents('TabEnter', [TkEnterAsTab]);end;
end.
Gostei + 0
10/02/2011
Mauricio Rodrigues
Gostei + 0
10/02/2011
Km Sistemas
Gostei + 0
10/02/2011
Km Sistemas
Link: http://www.raize.com/DevTools/RzComps/Default.asp
Gostei + 0
16/05/2013
José
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)