all groups > dotnet windows forms designtime > june 2004 >
You're in the

dotnet windows forms designtime

group:

How do I get the ControlDesigner for a control?


How do I get the ControlDesigner for a control? schneider
6/10/2004 1:30:55 AM
dotnet windows forms designtime:
Anyone tell me how to get the ControlDesigner for any control?

I need to check the selection rules, and other things.

A samle would be great, or a website...


Thanks,


Schneider

Re: How do I get the ControlDesigner for a control? schneider
6/10/2004 1:42:02 AM
I think I found It.

TypeDescriptor.CreateDesigner(component, gettype(idesigner))

This sound correct?

Any other details on using this method?

Thanks,

Schneider


[quoted text, click to view]

Re: How do I get the ControlDesigner for a control? Andrew S (Infragistics)
6/10/2004 1:53:44 PM
Actually I do not believe that is not correct since that will create a new
instance of the designer class for a control. What you want to do is use the
GetService method of the component to get the idesignerhost service. Then
use its GetDesigner method.
e.g.
IDesignerHost host = this.GetService(typeof(IDesignerHost)) as
IDesignerHost;
ControlDesigner designer = host.GetDesigner(this) as ControlDesigner;

[quoted text, click to view]

Re: How do I get the ControlDesigner for a control? schneider
6/10/2004 9:30:55 PM
That assumes that I have a host, but I don't currently need one.

Anyway, what I am trying to use the methods on the controlDesigner, and
derrived types.

I need to call CanBeparentedTo, CanParent

anyone know how?

seems you can only inherit thoes classes, and nothing else..

Thanks,

Schneider

[quoted text, click to view]

Re: How do I get the ControlDesigner for a control? Andrew Smith (Infragistics)
6/11/2004 9:41:46 AM
Well this is the designtime newsgroup so I assumed you were acting at
designtime and therefore would be able to get to the IDesignerHost. In
anycase, the methods you mention are public methods on the ControlDesigner
and ParentControlDesigner classes so you can call them once you have the
designer instance. Of course going the route you're going, you're going to
have to initialize the designer with its component and also be responsible
for disposing the designer.

[quoted text, click to view]

Re: How do I get the ControlDesigner for a control? schneider
6/11/2004 12:09:51 PM
thanks


"Andrew Smith (Infragistics)" <productmanager@infragistics.com> wrote in
message news:OsZkWn7TEHA.972@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button