Ver Mensaje Individual
  #1  
Antiguo 22-06-2015
ermac ermac is offline
Miembro
NULL
 
Registrado: jun 2015
Posts: 10
Reputación: 0
ermac Va por buen camino
Smile Rellenar una fila y columna dada en un TStringGrid

Tengo q hacer un programa en el cual rellene la fila y columna ingresada por el usuario

Mi codigo es el siguiente:
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Grids, ExtCtrls;

type
  TRellenar = class(TForm)
    Tabla: TStringGrid;
    Label1: TLabel;
    Fila: TEdit;
    Rellenar: TButton;
    Label2: TLabel;
    Columna: TEdit;
    Panel: TPanel;
    procedure RellenarClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Rellenar: TRellenar;

implementation

{$R *.dfm}

procedure TRellenar.RellenarClick(Sender: TObject);
var
i,j,m,n:integer;

begin
  i:= strtoint (Fila.Text);
  j:= strtoint (columna.text);
  If (i=0) or (j=0) then
    ShowMessage ('Error')
  else
  begin
    for m:=0 to Tabla.ColCount-1 do
    begin
      for n:=0 to Tabla.RowCount-1 do
        begin
          Tabla.Cells[m,0]:= '*';
          Tabla.Cells[0,n]:= '*';
        end;
    end;
  end;
end;

end.
Necesitaria saber como puedo hacer para q la fila y columna q ingresan en los edits me los relacione con los 2 for de abajo para q se rellene esa fila y columna

gracias

Última edición por nlsgarcia fecha: 23-06-2015 a las 00:09:39. Razón: Formateo y Sintaxis Delphi
Responder Con Cita