Ver Mensaje Individual
  #8  
Antiguo 11-08-2012
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola.

Otro enfoque, tal vez un poco menos elegante, puede ser:
Código Delphi [-]
...
implementation

procedure TForm1.DBEditContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean);
begin
  Handled:= True;
end;

procedure TForm1.DBEditKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
var
  Msg: TMsg;
begin
  if ((Shift = [ssCtrl] ) and (Key = Ord('V'))) then  // Ctrl+V
    PeekMessage(Msg, 0, WM_CHAR, WM_CHAR, PM_REMOVE);
  if (Shift = [ssShift])and(Key = VK_INSERT) then     // Shift+Insert
    Key:=0;
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
begin
  for i:= 0 to ComponentCount-1 do
    if Components[i] is TDBEdit then
    begin
      TDBEdit(Components[i]).OnContextPopup:= DBEditContextPopup;
      TDBEdit(Components[i]).OnKeyDown:= DBEditKeyDown;
    end;
end;
...

Saludos.
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita