Click here to Skip to main content
16,021,536 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have used flash file (SWF) in .net 2003 winforms. some time occured in the following errors

"Child is not a child control of this parent"

please help me : how to rectified and give to any solution.

my Code is :
Me.flaRandH = New AxShockwaveFlashObjects.AxShockwaveFlash
flaRandH.Movie = Application.StartupPath & "\test.swf"
flaRandH.SetVariable("Main.drDet.drTimeVal", "Welcome") ......
Posted

Daves fix worked for me.

As a bit of background I was in the designer and all I did was resize a user control (honestly!) and I suddenly got the referenced error message

Looking in the corresponding xxxxxx.designer.cs file I saw the line

MyForm.Controls.AddChildIndex(control,0) (which I didnt understand!)

replacing that line with

MyForm.Controls.Add(control)

and rebuilding fixed it. (I know you not supposed to edit this file, but it worked)
 
Share this answer
 
Comments
Shevchenko-adeen 16-Jul-20 10:04am    
For me, rather than "AddChildIndex", it presented "SetChildIndex", but the solution was the same.
You didn't add the newly created control to the Controls collection of a Form or some other container control like a Panel.

MyForm.Controls.Add(flaRandH)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900