How to call onChange event using FindComponent?
The Change()
method is protected
, so to call it directly like you are trying to, you would need to use an accessor class to grant access to the calling scope, eg:
type
TMemoAccess = class(TMemo)
end;
TMemoAccess(TMemo(FindComponent('mymemoname'))).Change();
Otherwise, you can just call the OnChange
handler directly instead:
var TheMemo := TMemo(FindComponent('mymemoname'));
TheMemo.OnChange(TheMemo);