使用VB.Net的Winform中的错误“子级不是此父级的子级控件". [英] Error in Winform using VB.Net "Child is not a child control of this parent"

查看:84
本文介绍了使用VB.Net的Winform中的错误“子级不是此父级的子级控件".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.net 2003 Winforms中使用了Flash文件(SWF).一些时间出现以下错误

孩子不是此父级的子控件"

请帮助我:如何纠正并给出解决方案.

我的代码是:
Me.flaRandH =新的AxShockwaveFlashObjects.AxShockwaveFlash
flaRandH.Movie = Application.StartupPath& "\ test.swf"
flaRandH.SetVariable("Main.drDet.drTimeVal",欢迎")......

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") ......

推荐答案

Daves修复程序对我有用.

作为背景,我在设计器中,我所做的只是调整用户控件的大小(老实说!),突然间我得到了引用的错误消息

在相应的xxxxxx.designer.cs文件中,我看到了

MyForm.Controls.AddChildIndex(control,0)(我不理解!)

将该行替换为

MyForm.Controls.Add(control)

并进行修复. (我知道您不应该编辑此文件,但是可以工作)
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)


您没有将新创建的控件添加到Form的Controls集合或其他容器控件中,例如面板.

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)


这篇关于使用VB.Net的Winform中的错误“子级不是此父级的子级控件".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆