DirListBox 中的 Visual Basic 兼容性 DLL 异常
我们从 VB 6 迁移到 VB.NET 2008。转换进行得相当顺利。 有一个问题是例外的。
InitializeComponent 中的以下行抛出异常。
Me.dirSelector = New Microsoft.VisualBasic.Compatibility.VB6.DirListBox
异常消息显示“属性值无效”。 它只发生一次。 之后一切似乎都正常。
声明如下
Public WithEvents dirSelector As Microsoft.VisualBasic.Compatibility.VB6.DirListBox
可能是什么问题?
问候,
克里什
We migrated from VB 6 to VB.NET 2008. Convertion went fairly well. There is one issue with exception.
The following line in the InitializeComponent throws exceptions.
Me.dirSelector = New Microsoft.VisualBasic.Compatibility.VB6.DirListBox
The exception message says that "Invalid Property value". It happens only once. After that everything seems to be working.
declaration as follows
Public WithEvents dirSelector As Microsoft.VisualBasic.Compatibility.VB6.DirListBox
what could be the issue?
Regards,
Krish
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 InitializeComponent 中很可能有一些属性分配给 dirSelector 属性(dirSelector.left = ...等)。 我猜想它是被标记的其中之一,并且由于它发生在初始化期间,因此您在调试模式下不会得到正常的黄线。 尝试注释掉这些或更改它们的值,看看这是否是问题所在。
There are most likely some property assignments to dirSelector properties in InitializeComponent (dirSelector.left = ..., etc). I would guess that it's one of these that is being flagged, and since it occurs during initialization you don't get the normal yellow line in the debug mode. Try commenting these out or changing their values to see if that's the problem.