如何实现双击stringgrid一行打开一个新的窗体,并在新窗体内显示该记录的详细信息。
解决方案 »
- 多语言版本的showmessage中的按钮中英文怎么办?
- 如何查询上月数据 的问题.急 急 急!!!
- delphi数据类型转换有哪些函数呢?
- Excel导人ACCESS的问题,求救!紧急!给点代码,我是菜鸟!
- oracle 怎么做简易客户端 使用ado来连接(问题解决,要多少分都可以)
- 三层通讯与客户端分发问题
- 各位大侠,小弟一事相问!!
- 删除MDAC2.7的目的是重装MDAC2.6SP1(D6+Mdac2.7老是出现"Either eof or bof is true...Error"),高分求救!!!!!!
- 请问那有stringgrid控件使用介绍的文章
- delphi各国语言显示
- DELPHI学习群
- 为什么释放子窗体前要通知主窗体
var
r:Integer;
begin
r := StringGrid1.Row ;
ShowMessage(StringGrid1.Cells[0,r] );
end;r是行,StringGrid1.Row是当前选中的行数,StringGrid1.Cells[x,y]是某个单元格的数据,x、y分别是行数和列数。
begin
with form2 do
begin
Edit1.Text := StringGrid1.Rows[StringGrid1.Row].Strings[1];
Show;
end;
end;procedure TForm1.MCFormCreate(Sender: TObject);
begin
StringGrid1.Cells[1,1] := 'test'
end;
begin
form2.Memo1.Lines.Assign(StringGrid1.Rows[StringGrid1.Row]);
form2.Show;
end;
ARow: Integer; var CanSelect: Boolean);
begin
with TForm2.Create(Owner,StringGrid1.Cells[ACol,ARow]) do
begin
showmodal;
Destroy;
end;
end;
///
unit Unit2;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm2 = class(TForm)
Edit1: TEdit;
private
{ Private declarations }
public
Constructor Create( AOwner:TComponent;s:string );overload;
{ Public declarations }
end;var
Form2: TForm2;implementation{$R *.dfm}{ TForm2 }{ TForm2 }constructor TForm2.Create(AOwner: TComponent; s: string);
begin
inherited Create( AOwner );
self.Edit1.Text:=s;
end;end.