I have a tabcontrol with 3 tabs.
Onto it have have placed a treeview and 2 listviews, all aligned alClient.
Then I am using this code to show the correct component per tab:
In the editor I can see the column headings of both listviews.
Both are set to visible=false in the editor, the treeview set to visible=true.
But when I run the prog and cycle the tabs, I cannot ever see ListView1.
I see TreeView1 on tab 1 OK, Listview2 column headings on tab3 OK, but nothing on tab 2.
I've checked through every single property and can see nothing that isn't the same.
Previously in this project I had 3 Treeviews, and I got it working no problem with same code concept as above.
Now I've swapped out two of them for ListViews I have this problem.
Any idea what is wrong?
Steve (Delphi 2007 & XP)
Onto it have have placed a treeview and 2 listviews, all aligned alClient.
Then I am using this code to show the correct component per tab:
Code:
procedure TMainForm.TabControl1Change(Sender: TObject);
begin
if TabControl1.TabIndex = 0 then
begin
TreeView1.Visible := true;
ListView1.Visible := false;
ListView2.Visible := false;
end;
if TabControl1.TabIndex = 1 then
begin
TreeView1.Visible := false;
ListView1.Visible := true;
ListView2.Visible := false;
end;
if TabControl1.TabIndex = 2 then
begin
TreeView1.Visible := false;
ListView1.Visible := false;
ListView2.Visible := true;
end;
end;
In the editor I can see the column headings of both listviews.
Both are set to visible=false in the editor, the treeview set to visible=true.
But when I run the prog and cycle the tabs, I cannot ever see ListView1.
I see TreeView1 on tab 1 OK, Listview2 column headings on tab3 OK, but nothing on tab 2.
I've checked through every single property and can see nothing that isn't the same.
Previously in this project I had 3 Treeviews, and I got it working no problem with same code concept as above.
Now I've swapped out two of them for ListViews I have this problem.
Any idea what is wrong?
Steve (Delphi 2007 & XP)