扩展了一个StringGrid 为名为CustomStrinGrid
发现在stringGrid中procedure TForm1.stringGridKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
Memo1.Lines.Add(stringGrid.Cells[1,1]);
end;在KeyUp时stringGrid.Cells[1,1]的值就已经写入到了内部的TStrings中我在CustomStrinGrid中同样也定义了一个 A:TStrings变量 ,
我希望在StringGrid在写入的同时也将值写入到自己定义的变量A中,不知道该如何实现?
发现在stringGrid中procedure TForm1.stringGridKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
Memo1.Lines.Add(stringGrid.Cells[1,1]);
end;在KeyUp时stringGrid.Cells[1,1]的值就已经写入到了内部的TStrings中我在CustomStrinGrid中同样也定义了一个 A:TStrings变量 ,
我希望在StringGrid在写入的同时也将值写入到自己定义的变量A中,不知道该如何实现?
解决方案 »
- 语音开发包
- 怎么样把多个相同的空间放在一个数组里面呢?
- 请高手解释一系列关于Delphi6 QiuckRep 的问题,共记300分,参与者有份,解决立即揭贴,谢谢
- 大家都来留个联系方式吧。便于技术交流 : ) 散分!
- 判断位数
- !!! 类函数和self !!!
- 用Delphi如何识别EDIT1的最后几个字母
- 如何判断对象是否已经Create
- 我想用installshield发布ADO和SQL_SERVER2000的程序,对于数据库的结构,不知道如何发布才可以?谢谢.
- 送分,旧帖重贴:最近一不小心,发现自己水平越来越低。。请大家讨论,如何提高自己。。。
- 如何实现dbgrid动态绘色功能,各位大侠请拍砖扔玉
- 请教关于MIDI端口的获取方法(解决了再+100分)
procedure TForm1.stringGridKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
CustomStrinGrid1.A:=StringGrid1.Cols[1];
Memo1.Lines.Add(stringGrid.Cells[1,1]);
end;上面是你给定了行值和列值为1,我觉得你写在KeyUp事件里不大好。不如写在SetEditText事件中procedure TForm1.StringGrid1SetEditText(Sender: TObject; ACol,
ARow: Integer; const Value: String);
begin
CustomStrinGrid1.A:=StringGrid1.Cols[acol];
showmessage('stringgrid:'+StringGrid1.Cols[acol].Strings[arow]);
showmessage('customstringgrid:'+CustomStrinGrid1.A.Strings[arow]);
Memo1.Lines.Add(stringGrid.Cells[1,1]);
end;不知道这样是不是想要的。