Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to visually design a custom component at design time?

I am venturing into making my own components in Delphi. I'm having difficulty getting started with component development.

I want to make a composite control ie a control made up of several other controls, eg like an address form or something like that.

I am descending from TWinControl. Would that be considered to be the correct choice?

The main thing is, I cannot see a way to visually design the component in D2010. Is this possible? eg drop some text boxes onto your component, as you would with a form. I'm hoping I don't have to hand code all the visual aspects to my own components..

Also any good links on delphi component dev would be very much appreciated - esp for composite controls. The docs are not A1, its a struggle. I searched a lot already, I'm still going nowhere fast.

like image 389
csharpdefector Avatar asked Aug 24 '10 20:08

csharpdefector


2 Answers

If you're making something with multiple controls such as an address form, you might consider making it a frame instead of a control. Frames can be designed like windows, and re-used.

like image 53
GrandmasterB Avatar answered Nov 15 '22 03:11

GrandmasterB


You'll have to describe it in code to compile, but you can use a trick to design the component visually at first.

Put a TPanel on the form, and let that stand for the base control. Arrange your sub-controls, then get the properties from text view. GExperts adds a menu option that will convert controls on a form to code to generate them automatically, making this step a lot easier.

like image 41
Mason Wheeler Avatar answered Nov 15 '22 04:11

Mason Wheeler