stringGrid.Row //行也
stringGrid.Col //列也
stringGrid.Cell[stringGrid.Col,stringGrid.Row] //格也
解决方案 »
- 今天老公过生日,放分庆祝!!!
- 谁给我讲讲有关内存操作的问题!
- 不普通的杀进程!
- 这样删除一个目录,目录下有文件
- 我的机子IP为192.168.1.111 可是我打上IP地址报告错误
- 最后的三分二号,仍然是先到先得。
- 怎么得到 我所点的TreeView1的上层的text
- 遇到无能的项目负责人,郁闷,散分
- 1-30个数中随意取13个号码,按7个一组进行组合的算法
- 上哪找TeeMach的TeeTree构件或RSD的DBTreeview构件,还有哪有ASPack减肥工具
- 关于动态创建TQRDbText时,为什么显示不出来数据库里指定的数据???
- 请问大家有没有碰过在richedit输入中文的时候显示不出来的情况
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.
应该是在Additional控件组的第四个吧,呵呵。