I have 2 forms, Form1(it contain 1 button only) and Form2(it contains a memo only). here is the code when I click the button :
begin
Form2.Parent := Self;
Form2.Show;
end;
it was OK, but when I click the memo
it can't get focus. But when I press tab, it can get focus. Why it can't get focus during click but it can get focus when I tab? How can I make it focusable when clicked?
EDIT
here is the code in my Form1 :
TForm1 = class(TForm)
btn1: TButton;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses
Unit2;
procedure TForm1.btn1Click(Sender: TObject);
begin
Form2.Parent := Self;
Form2.Show;
end;
and this is Form2 :
TForm2 = class(TForm)
memo2: TMemo;
private
{ Private declarations }
public
{ Public declarations }
end;