【问题标题】:Custom User Control Throws Null Reference VB6 to VB.NET Migration自定义用户控件引发空引用 VB6 到 VB.NET 迁移
【发布时间】:2014-05-31 01:33:42
【问题描述】:

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

【问题讨论】:

    标签: vb.net vb6 vb6-migration


    【解决方案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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-08
      • 1970-01-01
      • 2012-03-31
      • 2012-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多