Board index » delphi » Class not found? Converting TNotebook to TPageControl

Class not found? Converting TNotebook to TPageControl


2003-09-22 02:34:09 PM
delphi135
I just updated an old project by changing TNotebook to a TPageControl. I
modified all references in the form file and code in the process, adding
TPageControl and TTabSheet references as needed.
Now when I run the project I get a "TTabSheet" class not found error.
Strangely, when I add a new PageControl and at least on tab sheet the
problem goes away. Both the old and new PageControls behave correctly. If I
remove the new instance, the problem returns.
What's going on?
 
 

Re:Class not found? Converting TNotebook to TPageControl

"Ron" <XXXX@XXXXX.COM>writes:
Quote
I just updated an old project by changing TNotebook to a TPageControl. I
modified all references in the form file and code in the process, adding
TPageControl and TTabSheet references as needed.

Now when I run the project I get a "TTabSheet" class not found error.
Strangely, when I add a new PageControl and at least on tab sheet the
problem goes away. Both the old and new PageControls behave correctly. If I
remove the new instance, the problem returns.
Make sure you have "ConCtls" in the "uses" clause of your form. Delphi
adds that automatically normally. Also, at least one of each of those
objects must have a non-empty Name property.
Good luck.
Kurt
 

Re:Class not found? Converting TNotebook to TPageControl

Yes, ComCtrls is there. The app couldn't compile without it. This is a
runtime error.
I did find that the Tabsheets didn't have names, so I named them. However, I
still get the error at runtime. Where else should I look for an error?
"Kurt Barthelmess (TeamB)" <XXXX@XXXXX.COM>writes
Quote
"Ron" <XXXX@XXXXX.COM>writes:

>I just updated an old project by changing TNotebook to a TPageControl. I
>modified all references in the form file and code in the process, adding
>TPageControl and TTabSheet references as needed.
>
>Now when I run the project I get a "TTabSheet" class not found error.
>Strangely, when I add a new PageControl and at least on tab sheet the
>problem goes away. Both the old and new PageControls behave correctly. If
I
>remove the new instance, the problem returns.

Make sure you have "ConCtls" in the "uses" clause of your form. Delphi
adds that automatically normally. Also, at least one of each of those
objects must have a non-empty Name property.

Good luck.

Kurt

 

Re:Class not found? Converting TNotebook to TPageControl

"Ron" <XXXX@XXXXX.COM>writes:
Quote
Yes, ComCtrls is there. The app couldn't compile without it. This is a
runtime error.
Yes. it is because the code for TTabSheet didn't get linked in.
Quote
I did find that the Tabsheets didn't have names, so I named them. However, I
still get the error at runtime. Where else should I look for an error?
The only time I get this is by trying to dynamically create a
component of type TWidgit, where there are no Name'd TWidgit's on any
forms (at design time). You did not say so explicitly, but I had the
impression that you do have at least one named TTabSheet on one of
your forms, right? that is the only cause I know of.
Good luck.
Kurt