Discussion:
VS2005b2 SplitContainerDesigner - designer.Initialize throw an exception
(too old to reply)
Günter Lissner
2005-09-21 11:46:28 UTC
Permalink
Hallo all,

i try to adapt my windows forms editor to .NET Framework 2.0. Generally
it works, except with the "SplitContainerDesigner". If i use a
"SplitContainerDesigner" like in the following line:

aSplitContainerDesigner.Initialize(aSplitContainerComp);

an "Object reference not set to an instance of an object." exception is
thrown if the designer is initialized with a component.

Any suggestions what is wrong?

Following are a few lines of code to reproduce the behaviour:

[...]
IComponent aSplitContainerComp =
(IComponent)Activator.CreateInstance(typeof(SplitContainer));

System.ComponentModel.Design.IDesigner designer =
TypeDescriptor.CreateDesigner(aSplitContainerComp,
typeof(System.ComponentModel.Design.IDesigner));

try
{
designer.Initialize(aSplitContainerComp);
}
catch( Exception exc )
{
string Msg = exc.Message + exc.StackTrace;
}
[...]

Many thanks,

Günter Lissner
Susanne Hengelein
2005-11-08 15:07:50 UTC
Permalink
Hi Günter,

I have exactly the same problem. Did you find a solution?

Regards,
Susann

--
Susanne Hengelei
-----------------------------------------------------------------------
Susanne Hengelein's Profile: http://www.hightechtalks.com/m22
View this thread: http://www.hightechtalks.com/t224266
Günter Lissner
2005-11-14 08:31:54 UTC
Permalink
Hi Susanne,

sorry, i did not yet found a solution.

Greetings from Germany,

Günter
Post by Susanne Hengelein
Hi Günter,
I have exactly the same problem. Did you find a solution?
Regards,
Susanne
Vidocq
2008-06-15 19:16:47 UTC
Permalink
Hi ,

I had this same problem and did not find any solution on the net , eventually I resolved the problem so I thought I would share it ;)

to resolve the problem you must add a Site to both panels of the SplitContainer before initializing the SplitContainerDesigner.

greetings , vidocq_

From http://www.developmentnow.com/g/32_2005_9_0_0_602525/VS2005b2-SplitContainerDesigner--designer-Initialize-throw-an-exception.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com

Loading...