?
Solved

Add TGraphicControl to a TCustomPanel by DesginTime and RunTime

Posted on 2003-02-27
5
Medium Priority
?
137 Views
Last Modified: 2010-04-04
I'm looking for methods to add a TGraphicControl in a TCustomPanel by DesignTime (like TToolBar).
I also wont that TGraphicControl can be selected in Design mode for see and change property's.

I'have make a TComponentEditor with a property Add. It also work i designTime but my TGrahicContol can't be selected, my TGraphicControl is note registered in the DFM, when i run my project my TGraphicControl is note i m'y CustomPanel.

Lite exemple is welcome

P.S. Sorry for my bad english

Thanks for help.
0
Comment
Question by:bvdv
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
andrewjb earned 200 total points
ID: 8041051
set the TGraphicControl's Owner to be the Form rather than the custom panel

e.g.

tMyNewPanel.CreateNewGraphic;
begin
  tGraphicCOntrol.Create( Owner );  // His owner is my owner
end;


but you've got to watch out - if you can select it in the IDE, you can hit DEL and delete it.

Storing the graphic controls in a tComponentList will at least let you know when one gets destroyed...
0
 

Expert Comment

by:CleanupPing
ID: 9317037
bvdv:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 12

Expert Comment

by:andrewjb
ID: 9317204
Think I got it right!
0
 
LVL 10

Expert Comment

by:kacor
ID: 9981777
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to accept andrewjb's answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Merry Christmas and happy new year!

kacor
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question