AbhiJeet
asked on
Delphi inherited method
Hi Experts,
I have a form eg ManagerForm where i have buttons say refresh and delete. There is an action actionDelete associated with delete button.
There is another form which is visually inherited from this from say form1.
When i click Delete on form1 it goes to the click event in managerform which i have written as below:
procedure TManagerform.Deleteclick(s ender : TObject) ;
begin
actionDelete.Execute;
end;
It executes actionDeleteExecute in child form form1. Now i need to call the click event of refresh button after Delete is executed.
Hence i wrote as:
procedure TManagerform.Deleteclick(s ender : TObject) ;
begin
actionDelete.Execute;
tbRefreshexecute(sender);
end;
It does not call the tbRefreshexecute method written in the child form, what is wrong in the code?
I have a form eg ManagerForm where i have buttons say refresh and delete. There is an action actionDelete associated with delete button.
There is another form which is visually inherited from this from say form1.
When i click Delete on form1 it goes to the click event in managerform which i have written as below:
procedure TManagerform.Deleteclick(s
begin
actionDelete.Execute;
end;
It executes actionDeleteExecute in child form form1. Now i need to call the click event of refresh button after Delete is executed.
Hence i wrote as:
procedure TManagerform.Deleteclick(s
begin
actionDelete.Execute;
tbRefreshexecute(sender);
end;
It does not call the tbRefreshexecute method written in the child form, what is wrong in the code?
ASKER
It stops but my question was why it is not going to tbrefreshexecute in the child form as it goes for actiondeleteexecute method.
It depends on your tbrefreshexecute method. Cause as you're invoking it with sender, thus it gets the base forms button. So it does not know about the inherited child form.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If stops, then step over tbRefreshexecute manually. If no action is seen, then debug tbRefreshexecute.