Tema: Grid
Ver Mensaje Individual
  #5  
Antiguo 22-04-2007
Robert01 Robert01 is offline
Miembro
 
Registrado: feb 2006
Ubicación: Córdoba, Argentina
Posts: 895
Reputación: 21
Robert01 Va por buen camino
Si lo que usás es un stringgrid podés mostrar el contenido de cada celda a medida que te sitúas sobre ella.

Código Delphi [-]
type
  TForm1 = class(TForm)
    StringGrid: TStringGrid;
    procedure ShowCellHint(X,Y:Integer);
    procedure StringGridMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }

  end;

var
  Form1: TForm1;
  LastRow, LastCol : Integer;

implementation

{$R *.dfm}

Procedure TForm1.ShowCellHint(X,Y:Integer);
var
  ACol, ARow : Integer;
begin
  If StringGrid.ShowHint = False Then
     StringGrid.ShowHint := True;
  StringGrid.MouseToCell(X, Y, ACol, ARow);
  If (ACol <> -1) And (ARow <> -1) Then
      StringGrid.Hint:=StringGrid.Cells[ACol,ARow];
  If (ACol<>LastCol) or (ARow<>LastRow) Then
  begin
    Application.CancelHint;
    LastCol:=ACol;
    LastRow:=ARow;
  end;
end;


procedure TForm1.StringGridMouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
begin
 ShowCellHint(X,Y);
end;

Saludos
Responder Con Cita