BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Avoiding "Control has no parent window" in a general way

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development)
View previous topic :: View next topic  
Author Message
raulmola
Guest





PostPosted: Thu Jan 04, 2007 10:53 pm    Post subject: Avoiding "Control has no parent window" in a general way Reply with quote



I'm writing a simple TreeView inherited form TCustomTreeView. Here is
the constructor


__fastcall TMyTreeView::TMyTreeView(TComponent* Owner)
: TCustomTreeView(Owner)
{
TFont * mf = new TMyFont();
Font->Assign(mf);
delete mf;
}

At design time the component is not created due to the message "Control
has no parent window"

This is not the first time i found this message and i wanted to know if
there is a common, a general way, to avoid this message. How do you
usually accomplish this ?.

In particular, i want my TreeView has an specific font when it's
dropped over a form. How could i accomplish this?

I think the perfect place to do this is the constructor because, in
fact, you are initializing the Font, but there is internal code that
prevents it. This shouldn't be so tricky.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.