自定义用户控件将空引用VB6引向VB.NET迁移

时间:2014-05-30 17:33:42

标签: vb.net vb6 vb6-migration

从VB6迁移项目后,在VB.Net中使用自定义用户控件时出现问题。只是想通过发布我的解决方案来节省一些时间,因为我在搜索后没有看到任何类似的内容。

1 个答案:

答案 0 :(得分:1)

问题是如果VB6中的用户控件使用UserControl_InitProperties()方法,它不会在VB.Net中自动调用,因此您需要在此处调用此方法:

 Public Sub New()
    MyBase.New()
    'This call is required by the Windows Form Designer.
    InitializeComponent()
    UserControl_Initialize()
    UserControl_InitProperties()
    End Sub