Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 28-05-2012
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Poder: 38
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.

Bueno, más o menos le había buscado por el mismo lado , te pongo la prueba que hice por si te ayuda en algo.
Código Delphi [-]
...
type
  TForm1 = class(TForm)
    StringGrid1: TStringGrid;
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    procedure StringGrid1SelectCell(Sender: TObject; ACol, ARow: Integer;
      var CanSelect: Boolean);
    procedure Memo1Exit(Sender: TObject);
  private
    procedure CMDialogKey(Var Msg: TWMKey);message CM_DIALOGKEY;
  public
  end;

var
  Form1: TForm1;

implementation 

var
  TabPressed: Boolean = False;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Memo1.Clear;
end;

procedure TForm1.CMDialogKey(var Msg: TWMKey);
begin
  if(ActiveControl is TMemo)and(Msg.Charcode = VK_TAB) then
    with StringGrid1 do
    begin
      Cells[Col,Row]:=  Memo1.Lines.Text;
      Col:= Col + 1;
      TabPressed:= True;
    end;
  inherited;
end;

procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
var
  Texto: string;
begin
  with TStringGrid(Sender) do
  begin
    Canvas.FillRect(Rect);
    Texto:= Cells[ACol,ARow];
    DrawText(Canvas.Handle, PChar(Texto), StrLen(PChar(Texto)),
    Rect, DT_WORDBREAK);
    if (gdSelected in State) and (ACol=1) then
    begin
      Memo1.Left := Rect.Left + Left + 2;
      Memo1.Top := Rect.Top + Top + 2;
      Memo1.Width := Rect.Right - Rect.Left;
      Memo1.Height := Rect.Bottom - Rect.Top;
      Memo1.Visible := True;
      Memo1.SetFocus;
    end
    else
      Memo1.Visible := False;
  end;
end;

procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
  ARow: Integer; var CanSelect: Boolean);
begin
  Memo1.Lines.Text:= StringGrid1.Cells[ACol,ARow];
end;

procedure TForm1.Memo1Exit(Sender: TObject);
begin
  if not TabPressed then
   StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row]:=  Memo1.Lines.Text;
  TabPressed:= False;
end;


end.

Saludos.
__________________
Daniel Didriksen

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


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Cargar datos en StringGrid en tiempo de ejecucion!! ezequiel913 Varios 5 02-07-2011 23:37:42
Cargar imágenes en celdas de StringGrid dependiendo de una consulta en tiempo de eje gulder Varios 8 11-12-2008 20:58:45
desmarcar cell en un StringGrid elcigarra OOP 1 18-10-2005 10:34:49
StringGrid con celdas multilinea [Gunman] Tablas planas 2 19-09-2005 08:27:11
Tiempo de ejecucion? st7 Varios 3 11-05-2004 22:03:28


La franja horaria es GMT +2. Ahora son las 11:39:17.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi