Gary Becks
Gary Becks

Reputation: 885

Make Components In TpageControl Available To Only One Page

I am starting on my first application using delphi (using delphi XE 2) and I'm trying to piece my way through creating the GUI right now.

I'm trying to use a TpageControl to keep things separated and simple but when I try to place a component on a tabsheet it shows on all of them. According to what I have read the components placed on each given tab are only supposed to show in that one.

Basically I want each tab to operate as a separate form. Does anyone have any tips and/or tutorials on working with the Tpagecontrol in order to do what I have described?

Thanks.

Upvotes: 1

Views: 1837

Answers (1)

Sir Rufo
Sir Rufo

Reputation: 19096

Just have a look at the structure and you will see why this happens.

PageControl Screenshot

Button1 and Button2 seems to be related to TabSheet1, but looking at the structure you will see, that the parent of Button1 is Form1 and the parent of Button2 is TabSheet1.

If you switch to TabSheet2 Button1 is still visible, but Button2 is not.

But you can drag drop the controls within the structure panel from actual parent to a new parent.

Upvotes: 10

Related Questions