I intermittently get this in error in my .NET 1.1 C# Windows Forms application. Someone indicated that this is due to a bug in the 1.1 framework and suggests putting the following code into any custom controls.
protected override void OnParentChanged(EventArgs e)
{
if (this.Parent != null)
{
this.CreateParams.Parent = this.Parent.Handle;
this.RecreateHandle();
}
base.OnParentChanged(e);
}
Has anyone else found that this solved the problem for them? Can anyone provide a way to consistently reproduce the error, so I can verify it is fixed after I apply the changes?
If there is an alternative solution I'm open to that as well.