例如: stringgrid 中9个格
1 2 3
4 5 6
7 8 9
我将鼠标移至8那个格子时 击鼠标右键如何获得那格子的文本信息
1 2 3
4 5 6
7 8 9
我将鼠标移至8那个格子时 击鼠标右键如何获得那格子的文本信息
解决方案 »
- 照抄网上的代码出错,请帮看看?
- 一个application 如何编译成多个exe程序?
- 如何突破(非破坏)还原精灵的限制往硬盘里写东西
- DLL调用的奇怪问题,高手请进。。。
- 请教一个INDY控件组中的idtcpserver 怎样获得客户连接的IP。
- pwl密码文件怎样查看????
- 怎么样将一个文本和图片混合的文件中的图片流数据提取出来并且保存到一个图片文件中
- 谁用过Install Shield for Delphi?一个关于目录的问题?
- 这一天没完没了地晕,,,,,,,,,,,,,
- 求救,十万火急!!!!!!!请各位高手指点,谢谢,万分感谢!
- 连续的时间字符串转换为时间
- 求助下VB6下的API如何在Delphi中使用
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
c,r : integer;
begin
StringGrid1.MouseToCell(x,y,c,r);
showmessage(StringGrid1.Cells[c,r]);
end;
procedure TForm1.StringGrid1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
c,r : integer;
begin
if button=mbRight then begin {--Èç¹û°´ÁËÓÒ¼ü--}
StringGrid1.MouseToCell(x,y,c,r);
showmessage(StringGrid1.Cells[c,r]);
end;
end;
procedure TForm1.StringGrid1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
c,r : integer;
begin
if button=mbRight then begin {--右键判断--}
StringGrid1.MouseToCell(x,y,c,r);
showmessage(StringGrid1.Cells[c,r]);
end;
end;
原代码如下:
procedure TForm1.FormCreate(Sender: TObject);
var
i, j: Integer;
begin
for i := 1 to 16 do
for j := 1 to 16 do
StringGrid1.Cells[i - 1, j - 1] := IntToStr(i * j);
end; procedure TForm1.Button1Click(Sender: TObject);
begin
frxReport1.ShowReport;
end; procedure TForm1.frxReport1BeforePrint(c: TfrxReportComponent);
var
Cross: TfrxCrossView;
i, j: Integer;
begin
if c is TfrxCrossView then
begin
Cross := TfrxCrossView(c);
for i := 1 to 16 do
for j := 1 to 16 do
Cross.AddValue([i], [j], [StringGrid1.Cells[i - 1, j - 1]]);
end;
end;
这样是没有问题的!!!
一旦,在StringGrid的任一个单元格输入“中文”字符就提示出错!提示“Could not convert variant of type(String) into type (Double)'