templated control designers and default controls

R

Rick

I'm trying to develop a designer that will allow a developer to drag and
drop a control onto the design surface and right click it to edit two
templates, the two templates being panels for other controls to be
dropped onto. This all works fine but what I really want to have is a
set of default controls already in the panels (couple of labels,
textboxes, that sort of thing) when the templates are edited. Is there
any way of adding default controls in this way at design time ? I'm
gradually coming to the conclusion that it can't be done !

Furthermore, if I do somehow manage to get a set of default controls to
appear, is it possible to make these read only whereas any other
controls dropped into the panel would be read/write ? From what I've
read so far it would appear that this is not currently possible, can
anyone confirm this ?

Any help/advice most gratefully received.

Dr Richard Edwards, .NET Developer
http://www.sift.co.uk
 
J

John Saunders

Rick said:
I'm trying to develop a designer that will allow a developer to drag and
drop a control onto the design surface and right click it to edit two
templates, the two templates being panels for other controls to be
dropped onto. This all works fine but what I really want to have is a
set of default controls already in the panels (couple of labels,
textboxes, that sort of thing) when the templates are edited. Is there
any way of adding default controls in this way at design time ? I'm
gradually coming to the conclusion that it can't be done !

Furthermore, if I do somehow manage to get a set of default controls to
appear, is it possible to make these read only whereas any other
controls dropped into the panel would be read/write ? From what I've
read so far it would appear that this is not currently possible, can
anyone confirm this ?

At run time, you can create a default template by instantiating a class
which implements ITemplate and using it to set your template property. It
would be interesting to see if that works at design time at all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top