How do I make rectangle appear before and during loading frame into TabItem?

  

My project is for Android platform using Delphi.
the project consists of:

Main form : It contains

TTabControl with 2 TTabItems : I placed on the first TabItem1 buttons ..
One Rectangle : I placed inside it Label1 with text ‘Please wait ..’, and set Visible property to False.

DataModule : SQLite Database, …

One FireMonkey frame: it contains TListView to display data from sqlite db, …

And the code is like this :
uses … , Unit1;


private
fFrame1: TFrame1;

procedure TMainForm.Button1Click(Sender: TObject);
begin
if fFrame1 = nil then
begin
Rectangle1.Visible := True;
fFrame1 := TFrame1.Create(Application);
fFrame1.Parent := TabItem2;
Rectangle1.Visible := False;
end;
TabControl1.ActiveTab := TabItem2;
end;

The Frame1 takes some time to load into TabItem2, but everything is done correctly..
The problem here is that the rectangle is not displayed before or during loading Frame1 ..
I have tried many times but always the rectangle remains hidden and does not appear.
Any help..

Comments are closed.