type t_bconfig_cmd_shower=class(tdcreateform) uses tslvcl; panel1:tpanel; bt_ok:tbtn; memo1:tmemo; bt_copy:tbtn; cpbord:tclipboard; function Create(AOwner);override; //构造 begin inherited; end function bt_copy_clk(o;e);virtual; begin s := memo1.text; cpbord.text := replacetext(s,"\r\n"," ");; end function bconfig_cmd_shower_close(o;e); begin EndModal(1); e.skip := true; end function btn1_clk(o;e); begin EndModal(1); end function set_config_text(s); begin memo1.text := s; end function DoControlAlign();override;//对齐子控件 begin //当窗口大小改变时,该函数会被调用, //可以通过 clientrect 获取客户区大小,设置子控件的位置以及大小 //如果自己处理了子控件的对齐,就可以去掉 inherited inherited; end function Recycling();override; //回收变量 begin inherited; ci := self.classinfo(); //将成员变量赋值为nil避免循环引用 for i,v in ci["members"] do begin if v["const"] then continue; if v["static"] then continue; invoke(self,v["name"],nil); end end end