TDBGrid控件OnCellClick事件中如何根据TColumn参数获取对应的TDBGrid对象
void __fastcall TfmJlzlSPXdzl::RzDBGrid_WTCXCellClick(TColumn *Column){ this->ShowInfo(this->RzDBGrid_WTCX);}//---------------------------------------void __fastcall TfmJlzlSPXdzl::RzDBGrid_ZLCXCellClick(TColumn *Column){ this->ShowInfo(this->RzDBGrid_ZLCX);}void __fastcall TfmJlzlSPXdzl::ShowInfo(TRzDBGrid* sqlgrid){ AnsiString fieldname,fieldvalue; for(int i=0;i<sqlgrid->FieldCount;i++) { fieldname = sqlgrid->Fields[i]->FieldName.LowerCase(); fieldvalue = sqlgrid->Fields[i]->Text; if(fieldname == "zjmc") { this->Rzedt_ZJMC->Text = fieldvalue;} else if(fieldname == "zqmc") { this->Rzedt_ZQMC->Text = fieldvalue;} }}
void __fastcall TfmJlzlSPXdzl::FormCreate(TObject *Sender){ this->RzDBGrid_WTCX->OnCellClick = RzDBGrid_CellClick; this->RzDBGrid_ZLCX->OnCellClick = RzDBGrid_CellClick;}void __fastcall TfmJlzlSPXdzl::RzDBGrid_CellClick(TColumn *Column){ //这里使用TColumn参数获取对应的TDBGrid对象调用ShowInfo函数}