I have a main form with TPanel
. I have also a Form2
with a TButton
which I show in TPanel
as a child. I mean TPanel
of main form is parent of Form2
. I use these steps to create the form2 in MainForm
OnCreate
method
MainFormOnCreate()
Form2 := TForm2.create(nil)
Form2.Parent := Panel1;
Form2.show;
But the problem is that when I access the button on Form2
it does nothing. For example, when I want to disable the button on Form2
I use this method
A button2 on main form with on click event
btn2OnClick();
Form2.btn.enabled := false;
But it does nothing. Some friends says it's because of child to TPanel
it will get no message.
So give me a solution. Thanks in advance