设置对应的edit与checkbox的tag相同for i:=0 to self.components.count-1 dobeginif component is tedit thenbeginmyEdit:=component as tedit;for j:=0 to self.components.count-1 dobeginif (component is tcheckbox)and((component as tcheckbox).tag=myEdit.tag) thenbegin((component as tcheckbox).check:=myEdit.text='a';end;end;end;end;