1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37:
| procedure TForm1.FormCreate(Sender: TObject); var j: Integer; p: PPropInfo; list: array of TMethod; niler: TMethod; begin SetLength(list, ComponentCount); niler.Code := nil; niler.Data := nil;
for j := 0 to ComponentCount-1 do begin p := GetPropInfo(Components[j].ClassInfo, 'OnChange'); if (p <> nil) and (p^.setProc <> nil) then begin list[j] := GetMethodProp(Components[j], p); SetMethodProp(Components[j], p, niler); end else list[j] := niler; end;
edit1.Text := 'ds'; edit2.Text := 'ds'; edit3.Text := 'ds'; edit4.Text := 'ds';
for j := 0 to ComponentCount-1 do begin p := GetPropInfo(Components[j].ClassInfo, 'OnChange'); if (p <> nil) and (p^.setProc <> nil) then begin SetMethodProp(Components[j], p, list[j]); end; end; end; |