stringGrid.Row     //行也
   stringGrid.Col     //列也
   stringGrid.Cell[stringGrid.Col,stringGrid.Row]    //格也 
   

解决方案 »

  1.   

    CellRect好象是这个函数,查一下吧。
      

  2.   

    请问在那里找到stringGrid控件的,我的delphi5里怎么找不到???????
      

  3.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs,  StdCtrls, Grids, Menus;type
      TForm1 = class(TForm)
        PopupMenu1: TPopupMenu;
        a1: TMenuItem;
        b1: TMenuItem;
        c1: TMenuItem;
        StringGrid1: TStringGrid;
        procedure StringGrid1MouseDown(Sender: TObject; Button: TMouseButton;
          Shift: TShiftState; X, Y: Integer);
        procedure FormCreate(Sender: TObject);
        procedure a1Click(Sender: TObject);
        procedure b1Click(Sender: TObject);
        procedure c1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;
      fixk,fixc : integer;
      currow, curcol: integer;
    implementation{$R *.dfm}procedure TForm1.StringGrid1MouseDown(Sender: TObject;
      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin
    if Button = mbRight then
    begin
      currow := y div fixk;
      curcol := x div fixc;
    end;
    end;procedure TForm1.FormCreate(Sender: TObject);
    begin
      fixk := StringGrid1.RowHeights[0];
      fixc := StringGrid1.ColWidths[0];
    end;procedure TForm1.a1Click(Sender: TObject);
    begin
      StringGrid1 .Cells[curcol,currow] := a1.Name;
    end;procedure TForm1.b1Click(Sender: TObject);
    begin
      StringGrid1 .Cells[curcol,currow] := b1.Name;
    end;procedure TForm1.c1Click(Sender: TObject);
    begin
      StringGrid1 .Cells[curcol,currow] := c1.Name;
    end;end.
      

  4.   

    stringGrid在哪里,我找不到~~~~~~~~~~~~~~
      

  5.   

    谢谢各位,让我试试。to  loader(大伦!加油!) :
       应该是在Additional控件组的第四个吧,呵呵。