在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
program ScriptRenameZL; uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, TypInfo, ToolsAPI,CnCommon, CnWizUtils,CnWizIdeUtils,IdeInstComp; //IdeInstComp CnWizIdeUtils CnWizUtils { Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, TypInfo, ToolsAPI,CnCommon, CnWizUtils,CnWizIdeUtils;} var //DesignContainer, Comp: TComponent; DesignContainer:TCustomForm; comp:TWinControl; I,CompCount: Integer; begin //for I := 0 to Screen.FormCount - 1 do { var Menu: TMenuItem; MainForm: TCustomForm; Component: TComponent; begin MainForm := GetIdeMainForm; if MainForm <> nil then begin Component := MainForm.FindComponent('HelpMenu'); if Component = nil then begin ErrorDlg('Help Menu NOT Found.'); Exit; end; } DesignContainer := IdeGetDesignedForm(form1); //xe10.1 下不能用,之前在xe7下可以用 //DesignContainer := GetIdeMainForm; //DesignContainer := Screen.Forms[0]; if DesignContainer = nil then begin showmessage('NO form xxx Found.'); Exit; end; CompCount:= DesignContainer.ComponentCount; showmessage(inttostr(compcount)); for i := 0 to CompCount - 1 do begin //showmessage(DesignContainer.Components[i].classname); if DesignContainer.Components[i].classname='TEdit' then begin showmessage('a'); GetHzPyW(GetStrProp(DesignContainer.Components[i],'caption')) Comp :=TEdit(DesignContainer.Components[i]); SetPropValue(Comp, 'Name','edtzl'+ inttostr(i)); end; end; end.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论