——此文章摘自《Delphi 数据库开发经典案例解析》定价¥特价¥购买>>http://tracklinktechcn/?m_id=dangdang&a_id=A&l=&l_type= width= height= border= nosave> () 控件添加和设置完毕后为DBGrid的DBGridCellClick事件添加处理代码添加这一事件的目的是因为我们使用的是文本框控件Edit因此必须自己编写代码将DBGrid中的数据读入到相应的各个文本框里面代码如下 // //职员信息管理功能的实现 //职员信息维护 procedure TmainDBGridCellClick(Column: TColumn); //将用户在dbgrid上所选取的职员的全部信息添加到职员信息维护窗体中的相应文本框中 begin adotableRefresh; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; comboboxText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; comboboxText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; comboboxText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; editText:=dbgridFields[]AsString; //允许修改插入删除记录 buttonEnabled:=true; buttonEnabled:=true; buttonEnabled:=true; end; right>[http://developcsaicn/delphi/htm>] [] |