在dbgrid表定义两个编辑字段,一个是manno(员工编号),一个是invoiceno(单据编号),点击manno字段,显示a窗体,点击invoiceno字段显示b窗体,请教高手,如何实现此项功能????
解决方案 »
- delphi 2007中的notebook组件是怎么用的?
- 数据流类Tmemorystream与Tstream有什么区别?
- 哪位大虾有sha算法的实现,请帮帮小弟。在线等待。
- 哪位高手知道怎样根据给定的WAV文件画出波形图???帮帮忙啊,谢谢了!
- 在idtcpserver的OnExecute事件中使用ADOQuery控件从数据库取数据的问题!!(急,在线等!!)
- 用DELPHI怎样取得Ring 0级权限
- 急急急!从没用过SQLSERVER的text字段,请问如何结合DBMemo进行编辑和保存??
- 程序循环问题,高手进!!!!!!
- +++++csdn的《程序员大本营》borland版好吗?里头的控件新吗?++++++
- delphi里clientsocket控件的问题!急!急!急!
- DBGrid如何纵向合并单元格呀
- 关于case的问题
procedure TFrom1.DBGrid1CellClick(Column: TColumn);
begin
inherited;
if Column.Index=1 then
begin
A:=TA.Create(Self);
A.ShowModal;
A.Free;
end
else
begin
B:=TB.Create(Self);
B.ShowModal;
B.Free;
end;
end;
Forma.ShowModal;
if DBGrid1.SelectedField.FieldName='invoicenono' then
Formb.ShowModal;
procedure Tmainform.dbgrid1editbuttonclick(sender:Tobject);
begin
if dbgrid1.selectedfield=dmdata.table1 then
with Ttable1.create(self) do
try
dmdata.table2.locate('IDNO',dmdata.table1IDNO.value,[]);
if showmodal=mrok then
with dmdata do
begin
if not (table1.state in [dsedit,dsinsert]) then
table1.edit;
table1IDNO.value:=table2.fields[0].value;
end;
finally;
free;
end
else
.......
begin
try
Forma:=TForma.Create(Application);
if Forma.ShowModal=mrOk then
Forma.ShowModal;
finally
Forma:=nil;
Forma.free;
end;
end;
if DBGrid1.SelectedField.FieldName='invoicenono' then
begin
try
Forma:=TForma.Create(Application);
if Formb.ShowModal=mrOk then
Formb.ShowModal;
finally
formb:=nil;
formb.free
end;
end;
begin
try
Forma:=TForma.Create(Application);
if Forma.ShowModal=mrOk then
Forma.ShowModal;
finally
Forma:=nil;
Forma.free;
end;
end;
if DBGrid1.SelectedField.FieldName='invoicenono' then
begin
try
Forma:=TForma.Create(Application);
if Formb.ShowModal=mrOk then
Formb.ShowModal;
finally
formb:=nil;
formb.free
end;
end;