1

I created a base TFrame class, eg TBasicFrame

There is one button called btnTest, which do a simple task

showmessage('test');

On another TForm or TFrame, I place this TBasicFrame on it. However, when I click this btnTest on this or TForm/TFrame which has an instance of TBasicFrame on it, the showmessage does not run.

What must I do to ensure that all code in the ancestor frame will execute? That means the showmessage('test') will run even when new instances of TBasicFrame is placed anywhere.

Any advice?

Peter Jones
  • 451
  • 2
  • 12
  • 1
    Could you edit your question and add complete code for a simple program which reproduce the issue? Publish pas et fmx files for main form and for frame(s). – fpiette Jan 05 '21 at 16:42

1 Answers1

0

I think, you overrided this event by simple double click on button (on object of your Frame) in IDE. So you dont have original call event. Check *.fmx files of TBasicFrame and TForm with object TBasicFrame.

  • so instead of double-click on the button of TBasicFrame instance in new form/frame, how should I do it? because when I double-click, there is an inherited; line put in, so I thought it will call the original event. – Peter Jones Jan 12 '21 at 15:08
  • Its old bug or bad trick. You need operate with component in Frame only in original class of Frame, not in instance of Frame. – Станислав 000 Jan 14 '21 at 12:57
  • My apologies... I'm afraid I don't quite understand what you mean. How do I when click on button in instance of TBasicFrame, get the button to run the code that was defined in the original TBasicFrame unit? Or are you saying that TFrame has an old bug that does not allow this to be done? – Peter Jones Jan 16 '21 at 05:48