当前位置: 代码迷 >> Delphi >> 初学者请求看一上这个小程序中的有关问题
  详细解决方案

初学者请求看一上这个小程序中的有关问题

热度:3671   发布时间:2013-02-25 00:00:00.0
菜鸟请求看一下这个小程序中的问题
unit Unit4;

interface

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

type
  TForm4 = class(TForm)
    StringGrid1: TStringGrid;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form4: TForm4;

implementation

{$R *.dfm}
procedure TForm4.FormCreate(Sender: TObject);//编译后总是在这里显示红色
var
  i: Integer;
begin
    for i := 1 to 9 do
       begin
         StringGrid1.Cells[i,0]:=IntToStr(i);
         StringGrid1.Cells[0,i]:=IntToStr(i);
       end;
end;
end.

------解决方案--------------------------------------------------------
Delphi?
------解决方案--------------------------------------------------------
这段代码没问题
是不是其他窗体调用FORM4的时候出错的
  相关解决方案