Ver Mensaje Individual
  #3  
Antiguo 05-10-2005
Avatar de ElDioni
[ElDioni] ElDioni is offline
Miembro Premium
 
Registrado: jul 2005
Ubicación: Murcia (España)
Posts: 935
Reputación: 19
ElDioni Va por buen camino
cogi tu procedimiento y lo he modificado un poco

Código Delphi [-]
procedure TGestionped.TxtProveedorKeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
var
  texto , campo : string;
begin
  if key=13 then
    begin
      if adoquery1.IsEmpty=false then
        begin
          txtproveedor.Text:=adoquery1.fieldbyname('proveedor').AsString;
          txtidprov.Text:=adoquery1.fieldbyname('idprov').AsString;
          txtobserv.SetFocus;
        end;
    end
  else
  begin
  if key=8 then
    begin
      if contador>0 then
        begin
          contador:=txtproveedor.SelLength+1;
          contador:=length(txtproveedor.text)-contador;
        end;
    end
  else
    begin
      contador:=length(txtproveedor.text)-txtproveedor.sellength;
    end;
  if adoquery1.IsEmpty=false then
    begin
          texto:=txtproveedor.text;
          campo:=adoquery1.FieldByName('proveedor').AsString;
          Delete(campo,1,length(txtproveedor.text)); //contador);
          txtproveedor.Text:=texto + campo;
          txtproveedor.SelStart:=contador;
          txtproveedor.SelLength:=50; //tamaño del campo
    end;
  end;
end;


Gracias por la ayuda me sirvio de mucho

Última edición por roman fecha: 05-10-2005 a las 17:12:34. Razón: agregar etiquetas [delphi] para mayor legibilidad
Responder Con Cita