Componente Enter x Tab
Amigos, alguem tem algum coponentes que façam o enter assumir a função de tab.
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]
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
Curtidas 0
Respostas
Luc.morais
05/06/2003
A biblioteca do Jedi disponível no site da borland possui um componente que faz isso. A biblioteca é muito grande e possui vários outros componentes.
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
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
Cristiane
05/06/2003
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
Vergilio Araujo
05/06/2003
criei uma unit com o nome TabEnter.pas salvei em algum lugar e fui no delphi7 e instalei como componente funciona perfeito no formulario que voce colocar o componente o enter funciona.
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.
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
Mauricio Rodrigues
05/06/2003
os componentes de automação comecial do ACBR tem
GOSTEI 0
Km Sistemas
05/06/2003
Os componentes do Raise Components tem a opção de funcionar o Enter como TAB tambem...
GOSTEI 0
Km Sistemas
05/06/2003
Os componentes do Raise Components tem a opção de funcionar o Enter como TAB tambem...
Link: http://www.raize.com/DevTools/RzComps/Default.asp
GOSTEI 0
José
05/06/2003
Este tópico esta sendo fechado por inatividade. Se necessário, sinalizar para que seja reaberto ou abrir um novo.
GOSTEI 0