Using Delphi 10 Seattle Update 1.
I want to create an instance of TTaskBar
at runtime in a VCL application. I found an interesting problem with TTaskBar
:
var F: TForm;
B: TTaskBar;
begin
F := TForm.Create(Application);
B := TTaskBar.Create(F);
B.TabProperties := [TThumbTabProperty.CustomizedPreview];
F.Show;
end;
The above code will raise an error: Could not register tab. Error 0
.
But, this code works:
var F: TForm;
B: TTaskBar;
begin
F := TForm.Create(Application);
F.Show;
B := TTaskBar.Create(F);
B.TabProperties := [TThumbTabProperty.CustomizedPreview];
end;
It seems that creating a TTaskBar
instance for a hidden form is not allowed.