Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Odd PageControl Behavior 1

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
I have a TPageControl with about 12 TabSheets. In the past I have added another PageControl to one of the TabSheets. Worked great, I now have a second set of tabsheets within a tabsheet page.

Now, I'm doing the exact same thing (I even started a new project and it worked the way I would expect) adding a new PageControl to one of my tabsheets. Except when I run my project, I don't get the tabs! I just get what looks like a panel where I would expect to see my new TabSheets.

Anybody run into this problem before? I have rebuilt the project, I have completely removed the offending PageControl and recreated it, and like I said above, I started with a new project and it worked there, but I can't get it to work properly in my existing project!

I'm about to tear my hair out trying to figure this out!!

Thanks,
Leslie
 
How much controls (including statics) are on your form?

TIA
TonHu
 
I don't know the exact number (is there a way to find that out easily?), but there's a lot of information. I have 1 PageControl with 13 tabsheets and each tabsheet is full of labels, DB controls, more pageControls.

Leslie
 
hi

May be an obvious thing this, but is your inner Page control aligned to client in it's parent tabsheet?

lou

 
I have tried it aligned and not aligned. It doesn't work either way.


Leslie
 
The max. number of controle on a form is somewhere around 250, as Windoze needs a few to handle the form. Could be you are reaching this limit?
Also be very precise on the parent(pwner) of each tabcontrol and the pages on it, it's easily messed up ;-)

HTH
TonHu
 
I may have that many, is there an easy way to get that number? ComponentCount?

Leslie
 
Ok I added this to the showForm event

Code:
ShowMessage(IntToStr(Form_CaseInformation.ComponentCount));

and got 264



Leslie
 
We have a main form with multiple nested page controls that works perfectly and returns a componentcount of 500.

Brian
"There are 2 kinds of people in the world, those that divide people into two groups and those that don't. I belong to the second group." - tag line I stole
 
I started adding more components (just DB aware components) and they worked fine, so I just abandoned the "too many" idea. It's just the pagecontrol that's acting up!



Leslie
 
OK, I figured it out! In my code I had this snippet:

Code:
  With Form_CaseInformation do
  begin
    For i := 0 to ComponentCount - 1 do
    begin
      If Components[i] is TTabSheet Then
        (Components[i] as TTabSheet).TabVisible := False;
    end;
  end;

So I have to explictly set the TabVisible back to True to see it!

DUH!

Thanks anyway!

leslie
 
This gives me ammo to shoot at (one of) the systems developers, working on our internal development framework. They keep telling me the max no. of controls on a form is ~250 (+/- 2), and they have to have 100, so I can't add more than 100 without trouble. It's just a whole different issue over here then!

Thanks guys!
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top